Forum Bugs

box-sizing table bug??

codecrafter
Hi,

It appears that the box-sizing css property 'border-box' is not honored for tables. I have a <th> and/or <td> element that contains a style with a specified width and padding. The table is laying out wider than expected because the padding is being added to the width rather than include within the width per { * box-sizing: border-box; }. Is this a bug?? I know that td and th or not technically block elements, but it appears that other browser honor this. Attached is an example html file. Just attach a style sheet with box-sizing set to border-box--the paragraph will honor but the table will not.
  1. tabletest.html3.8 kB
mikeday
We will add this to the roadmap for a future release, thanks for letting us know.
codecrafter
Hi,

I have an application where I'm trying to set a table's header to a fixed height. I'm not sure if the CSS specs. address this, but does the layout of a table's header (i.e. the th elements) follow a defined sizing model, like 'content-box' or 'border-box' in Prince? If not, is there a way for me to know what Prince does so I can fudge my HTML.

Thanks
markbrown
The height property on a table cell essentially just sets a minimum height on the row it is in. The row height takes into account the cell heights, allowing for baseline alignment and collapsing borders, and then each cell is padded out to that height.

Are you able to place a <div> between the <th> elements and their contents? Setting a fixed height on these divs should result in the row height also being fixed.
oodavid
I'm bumping into this at the moment with DocRaptor (pipeline 7 / PrinceXML 12).

I've "fixed" it by reverting my tables to use content-box, which is handy for us since we have a web "preview" of our printed docs on our dashboard.

Commenting to follow along for updates.
oodavid
This was fixed with PrinceXML 14:

https://www.princexml.com/releases/14/

> Fixed issue where box-sizing: border-box did not correctly apply to tables with fixed layout.