Hello, I have four div with fixed size 300px each, and a table dento of the first div, I need that when that table exceeds 300px the rest of the content goes to the second div and so on.
#pg1{
border: 1px solid black;
height: 600px;
width: 350px;
float: left;
top: 0px;
position: relative;
}
#pg2{
border: 1px solid black;
height: 600px;
width: 350px;
float: right;
top: 0px;
position: relative;
}
#tbl{
border: 1px solid black;
}
<div id="pg1">
<table id="tbl">
<thead>
<th>01</th>
<th>02</th>
<th>03</th>
</thead>
<tbody>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
<tr>
<th>AA</th>
<th>BB</th>
<th>CC</th>
</tr>
</tbody>
</table>
</div>
<div id="pg2">
</div>
<div id="pg3">
</div>
<div id="pg4">
</div>
I'm not able to do this and I've already scoured the internet.