<table>’s size and position now take <caption> into account

Published: | Categories: CSS, DOM


Previously, the <table> element’s offset*, client*, scroll* property values were excluding these values on the child <caption> element, which means only <thead>, <tbody> and <tfoot> were taken into account. For example, if <caption>’s clientHeight was 20 and <tbody>’s clientHeight was 80, <table>’s clientHeight would be 80, not 100.

Firefox 63 has updated the implementation to match the current CSSOM spec and other browsers’ behaviour, so the result of the example will be 100. This change may break existing code if it has special handling for Firefox to calculate expected values.