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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<thead style="display:table-header-group;"> blank page before ta

Status
Not open for further replies.

Tracey

Programmer
Oct 16, 2000
690
NZ
hi

could someone please tell me why this line of code is causing a blank page (well, it has the title only on top) to print before my table when the data in the table is larger than a page?

<thead style=&quot;display:table-header-group;&quot;>

if i remove this line, the data is printed directly below the heading regardless of how much data is in it.

I have used this before and have not seen this behaviour so i am bamboozled.

 
Hi,

If you use the thead element then you have to use the tbody and tfoot elements too and they must be within the table element and in this order:

<thead>header info</thead>
<tfoot>footer info</tfoot>
<tbody>body info</tbody>

Hope this helps!

Nate

mainframe.gif

 
o dear.. sorry for wasting your time.. all it was was no closing </thead>

urgh

interesting that you make that comment though, i dont use tfoot or tbody...
 
Do you use Internet Explorer? If so that's why it works. IE does a horrible job of outputting correct html and is really bad for showing what you want to see when it is not correct. If you try your site in Netscape or Mozilla or Opera is might not work. I never use these elements personally, I just have been taught that rule and w3schools backs that up too.

Nate

mainframe.gif

 
another interesting comment.

Everything is working fine in mozilla and opera

 
hmmm,

Well that is what I was first taught and is also what w3schools says:


Tips and Notes:

Note: If you use the thead, tfoot and tbody elements, you must use every element, but you can leave them blank. They should appear in this order: <thead>, <tfoot> and <tbody>, so that browsers can render the foot before receiving all the data. You must use these tags within the table element.


Maybe that rule is no longer in effect as the newer browsers come out. But like I said earlier I don't use these elements so I wouldn't really know. If it works, great.

Nate

mainframe.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top