I’m have a page that will be used (and hence styled) only for printing. When I view the page in the browser the column width are as I set them:
<table>
<col width="20%">
<col width="25%">
<col width="5%">
<col width="10%">
<col width="17%">
<col width="15%">
<col width="8%">
<thead>
header columns
</thead>
<tbody>
columns
</tbody>
</table>
However, when I print the page the columns are all identical widths. Am I able to set columns as percentages (or at all) when printing?
Try using
<table style="table-layout: fixed;">.This will force the table to use the specified widths.
Historically widths on table columns have always been more of a “suggestion” to the browser, and act more like a
min-widthto some extent. Settingtable-layout: fixedwill circumvent that.