Forum Bugs

Width and height 100% problem for content inside table cells

kkuzmenkov
Hi, currently I'm trying to draw table with crossed out cells (diagonal line inside table cells). Pseudo element that positioned absolutely is used to get this effect. Table cells have content with different height and width.

So, in HTML this line is drawn from corner to corner, but in PDF in looks corrupted (for some cells it is drawn like it is placed inside some virtual rectangle inside table cell). Looks like calculated width and height for pseudo element inside cell depends on content size of that cell and if content take just a part of it problem appears.

I attached sample html file for this problem. Is it known problem with printing tables, may be it has workarounds? Thanks in advance.
  1. sample.htm1.6 kB
markbrown
Hi,

The behaviour of position:relative on table cells is currently undefined in Prince, and I am unable to come up with any workarounds. We will add this to the roadmap.

Mark
kkuzmenkov
Mark, during tests for me it looks like it actually works, because pseudo element positioned correctly. E.g. right: 0; bottom:0; width:5px;height: 5px; places element at the right bottom corner, but it doesn't stretched correctly if width:100%; height:100%; are used).

Anyway, thanks for feedback! Will look forward for fix in new releases.
mikeday
We have improved support for relative positioning on table cells in the latest build, I hope it helps. :D