0

HI Friends,
I am using html and php for designing a report i want coding for displaying 2 table headers in subsequent pages.As I have 207 datas retrieved from mysql format:
categoy brand name model
xxx rtrt ghg iio
yyy jhkjk opo loo
i have to display the above data as
category
brand
name model
I have to repeat category name and brand name in subsequnt pages

4
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by mohan_iyyar
1

This is called pagination. You can find a lot of previous posts on this site if you do a search. You can find a lot of references on Google as well.

0

I need to check page break while printing huge table printing and also reeat the table headers after words

0

You can use paginated coding:

<?php
require_once "Paginated.php";
 
//create an array of names in alphabetic order
$names = array("Object1", "Object2", "Object3", "Object4", "Object5", "Object6");
  
$pagedResults = new Paginated($names, 10, 1);
  
echo "<ul>";
  
while($row = $pagedResults->fetchPagedRow()) {
  echo "<li>{$row}</li>";
}
  
echo "</ul>";
?>

Good Luck!

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

0

i want the coding in printing web pages for enabling table headers and disabling on the next page

0

is there is any code for genertating pdf files from mysql using limits and without white spaces in each page

0

When you mention disabling? What do you mean?
I'm assuming that you have a mysql table with 100's of rows of data.
You then want to 'chunk up' this data into displaying say 20 rows only.
You want a navigation system (like Google maybe) showing the next and previous 'chunks' of data. Is that right?

You can find a ready-written class for this - loads out there, or you can write your own.

The basics:

1. get the total number of rows in the DB that satisfy your general query (e.g. 497)
2. stipulate how many rows you want to display in your html table (e.g. 40)
3. calculate the number of 'pages' or 'chunks' of data that you need in total (e.g. 12)
4. see if a page number has be passed in the url (from a link), e.g. ...?page=4
5. if so, check the page is valid (numeric, not greater than total no. [12] and not less than [1]). Force the page number to 1 or 12 if it is invalid, depending on the actual value.
6. use the values so far to create a LIMIT clause (see mysql manual) and run the query
7. display the data from the query into html
8. display navigation links

It's not that difficult.

//BTW if you want to output this data in PDF, you may find this site interesting: http://www.tcpdf.org
There are loads of PDF classes out there, some very much better than each other. The one I've included seems to be the easiest and the best for me from a unicode point of view. There are loads of included examples in the download.

Edited by diafol: n/a

0

hi friends disablig the header means not displaying the header on the page

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.