Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Break, Table and MySQL

Status
Not open for further replies.

sharapov

MIS
May 28, 2002
106
US
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=\&quot;page-break-after: always;\&quot;> My problem is how can I make my code to insert this line (<tr style=\&quot;page-break-after: always;\&quot;>) 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&quot;<tr style=\&quot;page-break-after: always;\&quot;>&quot;; }

else {

echo&quot; <tr>&quot;; }

. . .
-----------------------------------------------------------
 
What do you exactly mean by 'it does not really work correctly'?

How does it show? What is the result?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top