I am retreaving my data from the MySQL database and display it inside HTML table. What I need to do is display every sixth row of the table on the new page (when user prints it). I know that it is possible with CSS if I do something like this: <tr style=\"page-break-after: always;\"> My problem is how can I make my code to insert this line (<tr style=\"page-break-after: always;\">) every sixth row? I tried to do the following but it doesn't really work correctly. Can anybody help?
-----------------------------------------------------------
. . .
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++) {
if($i%6==5){
echo"<tr style=\"page-break-after: always;\">"; }
else {
echo" <tr>"; }
. . .
-----------------------------------------------------------
-----------------------------------------------------------
. . .
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++) {
if($i%6==5){
echo"<tr style=\"page-break-after: always;\">"; }
else {
echo" <tr>"; }
. . .
-----------------------------------------------------------