I've been having problems with automatically breaking tables with a <caption> element that follows each page. The problem is, that once a page break happens, I can't remove the top margin of the first div inside the table.
The structure looks something like this:
On the first page there is 30px margin between breadcrumbs and the first child div. But when the table breaks the :first-child selector doesn't match as hoped and the margin becomes 60px.
I can't add margin bottom to <caption> since it's a table element and ignores margin. Making it a block element breaks the continuing caption functionality.
So far I've been unable to select the first element of each page to remove the top margin of the first div. A working solution would be to change the margin-top to margin-bottom but since my current project has been in the works for 3 months I'm hesitant to do big changes to the base styles as the publish date is close.
Does anyone know if there's another solution to this problem?
The structure looks something like this:
<table class="pdf-table">
<caption style="prince-caption-page: first">
<div class="breadcrumbs"><!-- stuff --></div>
</caption>
<caption style="prince-caption-page: following">
<div class="breadcrumbs"><!-- stuff --></div>
</caption>
<tr>
<td>
<div class="pdf-page-content">
<div></div>
<div></div>
<div></div>
</div>
</td>
</tr>
</table>
.breadcrumbs { margin-bottom: 30px; }
.pdf-page-content > div { margin-top: 30px; }
.pdf-page-content > div:first-child { margin-top: 0; }
On the first page there is 30px margin between breadcrumbs and the first child div. But when the table breaks the :first-child selector doesn't match as hoped and the margin becomes 60px.
I can't add margin bottom to <caption> since it's a table element and ignores margin. Making it a block element breaks the continuing caption functionality.
So far I've been unable to select the first element of each page to remove the top margin of the first div. A working solution would be to change the margin-top to margin-bottom but since my current project has been in the works for 3 months I'm hesitant to do big changes to the base styles as the publish date is close.
Does anyone know if there's another solution to this problem?
Edited by jiia