Xportability / css-to-pdf

Convert any HTML page or region to PDF - supports CSS, SVG, embedded XML objects, and more..
http://www.cloudformatter.com/CSS2Pdf
206 stars 78 forks source link

TD widths ignored #24

Closed fsodergren closed 8 years ago

fsodergren commented 8 years ago

This solution will work perfect for me, though for some reason the export is not respecting TD widths. http://codepen.io/fsodergren/pen/dMmdBQ It sets TD widths to 50% instead of what's in the style. Any idea on how to fix this?

cbrophy78 commented 8 years ago

Not sure if you figured this out, but what I noticed is:

  1. No matter what I put for the width of the <TD> in the print style it did not effect the output.
  2. However when I put the width on a <TH> it governed the whole column.
  3. Some things still ended up wonky and was able to still effect the foStyle on the text inside the <TH>.

If there is a better solution in sizing things I'd like to see it. I wasn't able to get a viable PDF based on my print css to match a printed sheet in div form. I needed to reformat everything into tables. Luckily the project was a static layout rather than responsive.

mthor commented 8 years ago

+1,

when opening the pdf all the are the same size

mthor commented 8 years ago

nevermind, I just figured it out, need to set the width on a <th> changed the <td> to <th> for the table headers