repeating headers of table

S

serge desmedt

Hi,

When using the following HTML, i do not ghet repeatinh headers in the print
preview of internet explorer 6.0

<html>
<head>
<title>Untitled</title>
</head>
<body>

<table>
<thead><tr><td>header</td></tr></thead>
<tbody>
<tr><td>body</td></tr>
<tr><td>body</td></tr>
<tr><td>body</td></tr>
<!-- repeat this a lot so the body spans multiple pages-->
<tr><td>body</td></tr>
<tr><td>body</td></tr>
</tbody>
</table>

</body>
</html>


When i look on the internet i should have repeating headers.

What am i doing wrong?

Serge Desmedt
 
R

rf

serge desmedt said:
Hi,

When using the following HTML, i do not ghet repeatinh headers in the print
preview of internet explorer 6.0

When i look on the internet i should have repeating headers.

What am i doing wrong?

Using IE, which does not support table headers correctly.

Cheers
Richard.
 
J

Jukka K. Korpela

serge desmedt said:
When using the following HTML, i do not ghet repeatinh headers in the
print preview of internet explorer 6.0

IE just doesn't do it. Try Mozilla.
<thead><tr><td>header</td></tr></thead>

I don't think there's a way to make it repeating on each line on IE 6.
You might copy the row itself so that it occurs at different places in
markup (e.g., after every 42 rows) and use CSS to suggest a page break
right. The main problem is that it depends on paper size, font size,
etc., how many rows actually fit on one page. Especially if e.g. only 40
rows fit, the result is awful.
 
R

rf

[post reformatted to alt.html conventions]
serge desmedt said:
rf said:
When using the following HTML, i do not ghet repeatinh
headers
in the
print
preview of internet explorer 6.0
What am i doing wrong?

Using IE, which does not support table headers correctly.
I just installed Opera 7.51 and it doesn't work neither.

So, opera is broken as well. Does not surprise me :).

Try Mozilla.

Cheers
Richard.
 
S

serge desmedt

apparently TFOOT doesn't work in mozilla eather, but THEAD does.
However i found a solution for IE.
Thanks for your help.


rf said:
[post reformatted to alt.html conventions]
serge desmedt said:
rf said:
When using the following HTML, i do not ghet repeatinh
headers
in the
I just installed Opera 7.51 and it doesn't work neither.

So, opera is broken as well. Does not surprise me :).

Try Mozilla.

Cheers
Richard.
 
R

rf

serge desmedt said:
apparently TFOOT doesn't work in mozilla eather, but THEAD does.
However i found a solution for IE.

Well? What is it? I'm intrigued...

Cheers
Richard.
 
S

serge desmedt

<STYLE type="text/css">

THEAD { display: table-header-group; }
TFOOT { display: table-footer-group; }

</STYLE>
 
J

Jukka K. Korpela

serge desmedt said:
THEAD { display: table-header-group; }
TFOOT { display: table-footer-group; }

This is rather surprising. Where did you find this?

It's surprising that IE sort-of supports thead and tbody if you use such
CSS. Is it documented somewhere? Moreover, it seems that IE leaves some
spurious empty row before the footer row - though this may depend.
 
O

Owen Jacobson


I think he meant "Is it documented that IE behaves this way?".
It's probably just part of the customer experience strategy if the
proposed default rendering is not all of a sudden viciously available as
a default.

That, I'd buy. It seems spectacularly stupid that this isn't part of IE's
default rendering of the elements those CSS display values are essentially
named after...
 
J

Jukka K. Korpela

Owen Jacobson said:
I think he meant "Is it documented that IE behaves this way?".

Yes I did. And after some searching I actually found it. Microsoft has
documented it in the description of the 'display' property! It defines
the meaning of some values for the property as follows:

table-header-group Table header is always displayed before all other
rows and row groups, and after any top captions. The header is displayed
on each page spanned by a table.

table-footer-group Table footer is always displayed after all other
rows and row groups, and before any bottom captions. The footer is
displayed on each page spanned by a table.

<http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/
display.asp>

The descriptions do not echo the definitions in CSS specifications, which
are more abstract in this issue. So they are presumably meant to describe
the specific IE behavior

The document claims that the default for <thead>, <tfoot>, and <tbody> is
display: none, which of course isn't true. (By CSS rules, if you set
display: none for an element, the element is not shown, not matter what
you set for inner elements.) But this is probably meant to say that the
behavior described above is not default behavior but can be invoked in
CSS.

The feature is _not_ mentioned in the description of the <thead> element
at
<http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/
thead.asp>
That, I'd buy. It seems spectacularly stupid that this isn't part of
IE's default rendering of the elements those CSS display values are
essentially named after...

If a browser implemented thead and tfoot in an optimal way, the default
rendering would probably consist of making the header and footer repeat
on each printed page _and_ making the rest of the table, i.e. tbody
element(s), appear in a scrollable area between the header and footer
in screen rendering - naturally assuming that the size of the table
exceeds some reasonable limit. This is more or less the general idea. And
unfortunately there is no way to make IE do the latter using CSS - or is
there?
 
J

Jukka K. Korpela

Jukka K. Korpela said:

I have now played a bit with the
thead { display: table-header-group; }
and I have mixed feelings about it. On one hand, it's nice to be able to
specify automatically repeating header row(s). On the other hand, IE
still breaks a table row across pages when it likes. Moreover, if I have
a <thead> with two rows (for example) I cannot make just one of them
auto-repeating by setting display: table-header-group for it only.

Actually on my page http://www.cs.tut.fi/~jkorpela/iso8859/maps.htm8
which I reorganized to use the styling approach, instead of explicitly
repeating header-like rows, I get odd results in print preview: at the
end of the second page, there are just three cells from a row, and the
rest of the row is on the next page. Probably just casual, and surely
depends on printer settings and other factors, but it means it's still
risky. (Mozilla behaves much more predictably and does not require the
style sheet rule. If I need a long table printed nicely, I primarily try
using Mozilla.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top