# Skip to next page if content is splitting

**URL:** <https://www.phphelp.com/t/skip-to-next-page-if-content-is-splitting/35353>\
**Category:** HTML & CSS\
**Created:** [March 22, 2023, 1:50pm UTC](https://www.phphelp.com/t/skip-to-next-page-if-content-is-splitting/35353 "2023-03-22T13:50:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adem](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@Adem](https://www.phphelp.com/u/Adem)\
**Post date:** [March 22, 2023, 1:50pm UTC](https://www.phphelp.com/t/skip-to-next-page-if-content-is-splitting/35353/1 "2023-03-22T13:50:50Z")

</div>

Hello,

I create PDF with php using HTML table

I’m using the following css to jump to the next page if the last few rows of the table are split

```auto
tfoot > tr {
	page-break-before: avoid;
}

tfoot > tr:first-child {
	page-break-before: auto;
}

```

I added a second table after this table  
There are two rows in the table  
1st line header  
2nd line content  
For the second table I used the above css example

```auto
		tbody > tr {
			page-break-before: avoid;
		}
		
		tbody > tr:first-child {
			page-break-before: auto;
		}

<table>
<tbody>
	<tr>
		<th>TITLE</th>
	</tr>
	<tr>
		<td>content</td>
	</tr>
</tbody>
</table>

```

Second table jumps to next page if splitting  
BUT, if the content of the second table is more than one page only one page is available, the rest of the content is not available

I don’t want the second table to be split on the first table’s page, but I want it to be split on the next page  
how do i do this

---

<div class="post-metadata">

**Author:** ![Adem](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@Adem](https://www.phphelp.com/u/Adem)\
**Post date:** [March 23, 2023, 6:57am UTC](https://www.phphelp.com/t/skip-to-next-page-if-content-is-splitting/35353/2 "2023-03-23T06:57:37Z")

</div>

The second table is placed on the first page because there is no possibility of division.  
Perfect, no problem

 ![no problem2](https://www.phphelp.com/uploads/default/original/2X/8/8601975ae85d9e5cd77fe439ca73f96db6e629e9.png)

Jumped to the second page as the second table would be split.  
Perfect, no problem

 ![no problem](https://www.phphelp.com/uploads/default/original/2X/6/6c93dc32f28d38a6daf1fd6cb07114f5da986d5d.png)

The problem is here  
Second table content more than one page  
Placed the title on one page  
Placed content on next page, but content missing, supposed to be fourth page but not

 ![problem](https://www.phphelp.com/uploads/default/original/2X/6/646a52fde46ae4a137ef26c49dc3cc46265e019c.png)

How should I fix this problem?
