Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print a thin HTML table on multiple columns

I have a simple 2-column table that has A LOT of rows:

<table>
<tr><td>row 1 column1</td><td>row 1 column2</td></tr>
<tr><td>row 2 column1</td><td>row 2 column2</td></tr>
[500 more rows]
<tr><td>row 4999 column1</td><td>row 4999 column2</td></tr>
<tr><td>row 5000 column1</td><td>row 5000 column2</td></tr>
</table>

The columns are very thin, which means I can fit about 4 columns per page. (two table widths)

Is it possible to continue the table in another column on the same page, like the following: enter image description here

(The next page would start with row 93)

like image 744
clementgamache Avatar asked Jun 29 '26 15:06

clementgamache


1 Answers

@media print {
    body {
        column-count: 2;
        -webkit-column-count: 2;
        -moz-column-count: 2;
    }
}

Prints the website content in a two column layout.

like image 167
mafu Avatar answered Jul 01 '26 05:07

mafu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!