RE: HTML 5 suggestion for TABLE element

BD,

I would disagree that this should be part of a HTML specification. HTML
should represent only the structural and semantic mark-up of the page,
with style information (which this strongly suggests itself to me as
being) being represented in CSS.

With an appropriate addition/ modification to the CSS specification,
there would be no degradation to accessibility, nor would there be any
need to create such inappropriate elements such as "header DIV"s, and
"overflowing DIV"s to contain parts of the table.

The situation I envisage is where the following HTML mark-up (with
in-line CSS for compactness) would produce the desired result (a table
where the headers/ footers are visible, the central data scrollable, and
all correctly aligned):

<table>
<thead><tr><th>Header 1</th><th>Header 2</th></tr></thead>
<tbody style="height: 10em; overflow: auto">
<tr><td>R1 C1</td><td>R1 C2</td></tr>
<tr><td>R2 C1</td><td>R2 C2</td></tr>
....
</tbody>
<tfoot><tr><th>Header 1</th><th>Header 2</th></tr></tfoot>
</table>

Where this defines the body of the table as having a fixed height, and
to apply scrollbars (make scrollable) should the content of the body
exceed this. (Implementationally, space equivalent to the width of a
scrollbar would been to be reserved in the thead and tfoot to keep the
alignment correct)

Another possible way of implementing it would be to specify a CSS height
for the entire table, and having an additional CSS attribute along the
lines of "table-header: fixed" or "table-contents: scroll" applied to
the TABLE element. NB: As far as I know, there are already
table-specific CSS attributes (such as border-collapse), and
table-specific CSS attribute values (display: table-cell, table-row,
etc) and, as mentioned earlier, there's a whole section of CSS dedicated
to tables.

- JM

-----Original Message-----
From: public-html-comments-request@w3.org
[mailto:public-html-comments-request@w3.org] On Behalf Of Dahal, Biswa
Sent: 11 June 2009 16:13
To: 'public-html@w3.org'; public-html-comments@w3.org
Cc: 'Lachlan Hunt'; 'Giovanni Campagna'
Subject: RE: HTML 5 suggestion for TABLE element

My recommendation is to have the following attribute for tags: <thead>
and <tfoot>
Attribute: scroll = scrolling (default) | fixed
Reason: Wide use cases + I think CSS is not fully sufficient (details
below) Although it seems like a presentation issue for the most part, I
think having it in the HTML 5 spec will make sense because:


There are examples on the web where you can see that the fixed headers
(non-scrolling headers) for tables are achieved using CSS. 
The way this is done is by having one DIV element for fixed
header/footer and another DIV element below it to contain TABLE element
within it.
This table element will have its column widths fixed according to some
percentage values so that it aligns with the widths in the "fixed"
header DIV.

I think this CSS based approach makes the tables less accessible because
in the nested table you would have to either not have <thead> elements
or hide them (because you don't want to see two headers for the table). 

Second, I think the layout of the table is now less flexible because the
table is less fluid (you have to align the header DIV with table column
widths manually - change in one requires a change in the other + you
have to consider the width taken by scollbars in the overflowing DIV
that contains the table)

Although for the most part I think it appears to be a CSS issue, at
least for the two cases above I think it will be useful to have it part
of the TABLE - THEAD/TFOOT tags in HTML 5 spec.

Having it built as part of the TABLE allows the same fixed THEAD/TFOOT
elements to be read by screen readers for accessibility and removes the
burden from developers to address minute differences. 


Having a new style attribute, say "table-header: fixed",
"table-footer:fixed", I think ties style information to an "HTML
ELEMENT", (because those styles can only be applied to THEADs and
TFOOTs). Since CSS is presentational only and should be applicable to
any element (not just HTML elements), I don't think it should be a part
of CSS.

Looking forward to feedback.

Thanks,
BD






-----Original Message-----
Dahal, Biswa wrote:
> My recommendation is to add an attribute "scroll: scolling (default)
> | fixed" in<thead>  and<tfoot>  to allow them to be fixed (non
> scrolling headers / footers ). This is currently performed through CSS

> hacks and is not consistent across browser implementations.
> Example CSS implementation:
> http://www.ssi-developer.net/css/non-scrolling-table-hdr.shtml to 
> understand the effect. Alternatively, you can open Excel and use 
> "freeze panes" to view the effect.

Lachlan Hunt wrote:
..
..
..
In my opinion, using CSS to achieve this presentational effect is the
correct solution, and since there is an existing solution, it's not
clear what problem you're trying to solve.  I do not think introducing a
scroll attribute in HTML for this purpose would be a good idea.

But, you're free to send the idea to the HTMLWG for consideration if you
like.
..
..
..


-----Original Message-----
From: Giovanni Campagna
..
..
..
This does not belong to HTML, it belongs to CSS Tables Level 3, in
defining the meaning of height and overflow for table-row-groups
(currently undefined). You should forward this suggestion to
www-style@w3.org
..
..
..
-- 
Scanned by iCritical.

Received on Friday, 12 June 2009 06:59:22 UTC