Wednesday, September 29, 2010

Row groups in Css

Row group elements are almost never used, the main reason being a supposed lack
of browser support. The three possible row group elements—<thead></thead>,
<tbody></tbody>, and <tfoot></tfoot>—enable browsers to support the scrolling of the
body area of long tables, with the head and foot of the table remaining fixed.
Furthermore, when tables are printed, the aforementioned elements enable the table
head and foot to be printed on each page.
Although browser support comes up short in some areas, I still recommend using row
groups, because they encourage you as a designer to think about the structure of the
tables you’re creating. Also, although browsers don’t do all they might with the elements,
they still recognize them, which means they can be used as selectors in CSS, enabling you
to set separate styles for the head, body, and foot data.
When using row groups, you can have one or more tbody elements and zero or one thead
and tfoot elements. They should be ordered with the head first, foot second, and body/bodies third, thereby enabling the browser to render the foot prior to receiving all
of the data. Note, however, that despite this order in HTML, browsers visually render the
row groups in the order you’d expect: head, body, and foot.

No comments:

Post a Comment