Steps to reproduce
- Create a table with a cell inside.
- Set a min-width and a max-width in percent on the cell .
- Get the min-width or max-width value using getComputedStyle() or jQuery.
=> The result is always "0px".
This bug also exists on IE11, IE10, IE9. But on thoses browsers, we can use currentStyle wich is undefined in Edge.
Here is a CodePen to reproduce the problem : http://codepen.io/mlegait/pen/EyRmGp
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “Travis L.”
Changed Assigned To to “Bogdan B.”
As far as I know, setting min-width to a percentage value is ignored in all browsers except Firefox (and all browsers ignore max-widthttps://jsfiddle.net/o0o7dfyc/](https://jsfiddle.net/o0o7dfyc/)[https://jsfiddle.net/o0o7dfyc/](https://jsfiddle.net/o0o7dfyc/)
I would recommend not using the propery, the value Edge reports is the value it is actually using (the bug lies on the other browers). That’s not to say we could not fix that bug, but we are unlikely to.
I agree with you, it’s not a best practice to set a min-width to a percentage value. However we do use this value for our use cases so even if you don’t return a computed value (in pixels), we would expect the percentage value set by the CSS or JS and not simply 0px as it is returned right now.
Would you, by any chance, know some other way we could have the value in percentage (that could even work only on Edge) ?
Thank you for your answer.