user2579966
user2579966

Reputation: 21

HTML Table - Page Break on CELL condition

I've searched but cannot find an answer.

How do I print an HTML Table with page breaks based on the value of a particular cell.

Basically I want to print a list of addresses and have a new page when the road name changes.

Upvotes: 1

Views: 557

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201538

You can’t do this in HTML or in CSS. You need to mark the page breaks when generating the table or with client-side JavaScript. In either case, you just need to store the road name (which you need to get from somewhere according to the structure of the date). When processing a new row, you then just check the road name in its data against the stored value, and if they differ, emit

<tr style="page-break-before: always">

instead of a simple <tr> or, when doing this client-side, modify the style property of the tr element node accordingly.

Upvotes: 1

Related Questions