Set width in percentage
See original GitHub issueIs it possible to set min/max width in percentage rather than pixels? Giving the variable minWidth: '40%'
sets the inline style to 100px, which I think is the default.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:23
Top Results From Across the Web
Percentage-width divs followed by fixed width div
To be clear, I want div1, div2, div3 to occupy one third of the remaining width after the 200px div is added. What...
Read more >width | CSS-Tricks
When using percentage (%) for width, authors must be aware that the percentage is based on the element's parent, or in other words, ......
Read more ><percentage> - CSS: Cascading Style Sheets - MDN Web Docs
The <percentage> CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent...
Read more >CSS width property - W3Schools
Definition and Usage. The width property sets the width of an element. The width of an element does not include padding, borders, or...
Read more >24/25 - what is percentage width? (e.g. width:45%)
If #right selects an element whose parent is <body></body> , then that element will have a width equal to 45% of the body...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think this is an important feature. Feel free to narrow down the scope of the behavior. For instance, it is not unreasonable to require that all widths be percentages when using fractions. Admittedly this is a tradeoff, but hard-coding the width is definitely not ideal.
Given react-table is using flexbox, wouldn’t it make sense to allow setting the flex-grow and flex-shrink properties of each column instead of percentage widths? That should give you similar results if I understand flexbox correctly.