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

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.

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

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!

Member Avatar for diafol

@davidborg - won't get far without the paginated class

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

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

Member Avatar for diafol

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.