php - Cut/Split html table into N parts
one text
I am generating html table with many columns, the number of columns depends on the number of values in the database (so it may produce a very long table). I already tried using the 'flexbox' but I don't want my table to be so compressed, I want the width to be fixed. Is there a way to split the table into two or three parts? Let's say I want to make a table for the first 10 columns of data, then another table for the remaining columns. Thanks in advance.
<table class="table table-striped">
<thead><tr>
<?php
// $col = number of data in db
for($i = 1; $i <= $col; $i++)
{
echo '<th>some data</th>';
}
?>
</tr></thead>
<tbody>
<tr>
<?php
// $col = number of data in db
for($i = 1; $i <= $col; $i++)
{
echo '<td>some data</td>';
}
?>
</tr></tbody>
The code above displays a compressed table because of "too many" columns. Is there a way to cut the table and print the remaining columns next line?
Source