question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set width in percentage

See original GitHub issue

Is 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:closed
  • Created 7 years ago
  • Reactions:16
  • Comments:23

github_iconTop GitHub Comments

52reactions
abhandarucommented, Mar 15, 2018

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.

28reactions
colomarcommented, Nov 12, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found