When using table { border-collapse: collapse; }
combined with th { border-bottom: 11px solid black }
, it seems impossible to compute the border-bottom-width in JavaScript.
window.getComputedStyle(th).getPropertyValue('border-bottom-width')
does not help at all. Just see what this fiddle logs to the console in different browsers...
- Chrome:
11px
- IE11:
5.5px
- Firefox:
6px
If I remove border-collapse
all browsers return 11px
, as I would expect.
Is there a more reliable way to get the precise border-width when using border-collapse
? OR is there a way to get the height (including borders) of either the thead
, tr
or th
without running into the same inconsistencies between browsers?