|
Rank: Newbie Groups: Member
Joined: 1/20/2012 Posts: 6
|
We have a "stacked" column table. We wish to prevent page breaks between R1 and R2 rows (see below). page-break-after:avoid in the R1 class or page-break-before:avoid in the R2 class has no effect. However page-break-after:always or page-break-before:always does have the proper (although not desired) affect. Any suggestions?
<table> <thead> <tr class="H1"> <th width="32">H1C1</th> <th width="64">H1C2</th> <th width="64">H1C3</th> <th width="80">H1C4</th> <th width="32">H1C5</th> <th width="80">H1C6</th> <th width="48">H1C7</th> <th width="64">H1C8</th> <th width="64">H1C9</th> <th width="96">H1C10</th> <th width="96">H1C11</th> </tr> <tr class="H2"> <th>H2C1</th> <th>H2C2</th> <th>H2C3</th> <th>H2C4</th> <th>H2C5</th> <th>H2C6</th> <th>H2C7</th> <th>H2C8</th> <th>H2C9</th> <th>H2C10</th> <th>H2C11</th> </tr> </thead> <tbody> <tr class="R1"> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr class="R2"> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> ... A lot more R1 and R2 row pairs </tbody> <tfoot> <tr class="F1"> <th colspan="11" align="left">My Footer</th> </tr> </tfoot> </table>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
page-break-after:avoid will never work. "avoid" only works with page-break-inside because an avoid scope needs a clear top and bottom position, which are not defined for page-break-before or page-break-after. That's why you can only do "page-break-inside:avoid".
In your case, have you tried to apply "page-break-inside:void" on your thead element?
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 1/20/2012 Posts: 6
|
Using it on thead won't have the desired affect because it is the tbody that is paging. I did try:
<tbody class="nobreak"> <tr class="R1>... <tr class="R2>... </tbody> ... many repeated tbody groups <tbody class="nobreak"> <tr class="R1>... <tr class="R2>... </tbody>
and using page-break-inside in the nobreak CSS class. That worked. Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
I see what you meant. Glad that you got it working. Please feel free to let us know if you have any more questions.
Thanks!
|
|