Bug 3239 - overflow: auto should work on table sections (tbody scroll)
Summary: overflow: auto should work on table sections (tbody scroll)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: 412
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 24974 (view as bug list)
Depends on:
Blocks: 17139
  Show dependency treegraph
 
Reported: 2005-06-01 16:03 PDT by Dave Hyatt
Modified: 2024-01-23 00:20 PST (History)
32 users (show)

See Also:


Attachments
Testcase (1.62 KB, text/html)
2005-06-09 23:50 PDT, Joost de Valk (AlthA)
no flags Details
Scrollbars should appear on tbody. (4.87 KB, text/html)
2008-11-28 03:47 PST, Asad Zia
no flags Details
Test case for table with 100% width (13.35 KB, text/html)
2010-03-15 13:33 PDT, Jørn Holm
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2005-06-01 16:03:15 PDT
11/9/03 3:45 PM Jonathan Barbero:
* SUMMARY
It would be nice if Safari implemented the independent scrolling properties of THEAD, TBODY, and TFOOT 
table elements.  My understanding is that if the content within TBODY tags exceeds the table height, that 
said contents will receive scroll bars independent of the rows contained within THEAD tags.  The spec is 
described here:

http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.2.3
Comment 1 Dave Hyatt 2005-06-01 16:03:47 PDT
Apple Bug: rdar://3478312/
Comment 2 Joost de Valk (AlthA) 2005-06-09 23:50:05 PDT
Created attachment 2202 [details]
Testcase

Added a table in here with inline heights and css-styled heights, enjoy! :)
Comment 3 Eric Seidel (no email) 2005-12-28 00:47:37 PST
Beth was fixing code in this area very recently.  However I believe her work had to do with <td>'s instead 
of table regions (dave and beth would both know).  I would also note that we have the exact same 
rendering of the test case as does firefox.  So it's possible that either the test case is wrong or that both 
firefox and safari are "wrong" (in which case I'm not sure we'd want to change this.. at least not without 
checking WinIE).
Comment 4 Gérard Talbot 2006-04-01 17:18:36 PST
This page
http://www.w3.org/WAI/UA/TS/html401/cp1001/1001-THEAD-TBODY-TFOOT-OVERFLOW.html#test1
is a testcase on table section overflow from WAI.
Comment 5 Gérard Talbot 2006-09-09 21:28:06 PDT
Other testcase:

http://www.gtalbot.org/BrowserBugsSection/Opera9Bugs/Opera7BugTbodyOverflowAuto.html

Can someone add these 2 string/words into summary so that it can help searching+finding this bug:

scroll tbody

I do not have sufficient powers to edit summary :(
Comment 6 Terje Bless 2008-02-13 02:46:20 PST
Firefox 2.0.0.12 renders the test cases from Comment #4 and Comment #5 correctly (with scrollbars on tbody). Safari 3.0.4/5523.15 (the 10.5.2 release version) does not. I haven't checked nightlies.
Comment 7 Asad Zia 2008-11-28 03:47:42 PST
Created attachment 25570 [details]
Scrollbars should appear on tbody.

The previous test case did not demonstrate the use case discussed in this bug. I have reduced a test case from Comment #4 below that correctly reproduces the issue.
Comment 8 Cameron Zwarich (cpst) 2009-04-01 08:13:11 PDT
*** Bug 24974 has been marked as a duplicate of this bug. ***
Comment 9 Gérard Talbot 2009-04-01 12:05:12 PDT
Recently, I discovered that this is not a CSS 2.1 bug. The overflow property does not apply to table-row-group objects (like <tbody>) according to section 11.1.1 http://www.w3.org/TR/CSS21/visufx.html#overflow

regards, Gérard
Comment 10 Jørn Holm 2010-03-15 13:26:05 PDT
Even if overflow property does not apply to table-row-group objects, 
http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3
says: "Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot."
Comment 11 Jørn Holm 2010-03-15 13:33:31 PDT
Created attachment 50731 [details]
Test case for table with 100% width

jet another test case.
This one illustrates how nicely a table can resize with ellipsis on table cells, and hopefully in a near future, scrolling on tbody.
Comment 12 eric.bayard.18 2010-06-07 06:50:39 PDT
If it is not a bug is it possible to make it a feature request (legitimate one as W3C encourages this behaviour)
It is really a big bonus for long tables and works perfect in Firefox.
It is very complicated to achieve it with javascript as no browser behaves the same with scroll bar width.
Comment 13 dwilt4rville 2010-07-11 19:38:27 PDT
I'd love to see this added as a feature. It's basically impossible to do right now and have native column widths..
Comment 14 Þorgils Völundarson 2011-06-21 07:37:45 PDT
Would really like to see this feature asap. Any word on when this could possibly be fixed?
Comment 15 Joe Nelson 2011-08-22 14:48:28 PDT
I would like to see this feature as well, please. It is useful behavior for long tables.
Comment 16 Gérard Talbot 2011-08-22 20:48:46 PDT
(In reply to comment #10)
> Even if overflow property does not apply to table-row-group objects, 
> http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3
> says: "Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot."

To my knowledge, no testcase has ever been submitted with regards to this.
HTML 4.01 spec has not been maintained nor updated after its final release in dec. 1999.

There is no indication so far that HTML5 is going to suggest or state that scrolling bodies can be achieved independently of <thead> and <tfoot>:

HTML 5, section 4.9.1 Tabular data
http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#tabular-data 

HTML 5, section 4.9.5 The tbody element
http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#the-tbody-element


(In reply to comment #12)
> If it is not a bug 

It is not a CSS 2.1 spec violation. Overflow property does not apply to table-row-group objects (like <tbody>).

> It (...) works perfect in Firefox.

It does not work perfect in Firefox 5 and 6. Mozilla developers intentionally decided to make overflow property implemented in compliance with CSS 2.1. There is a mozilla bug report to that effect.

> It is very complicated to achieve it with javascript as no browser behaves 
> the same with scroll bar width.

You are right. It is moderately complicated with javascript but the main layout problem for web authors is that no web author can easily predict in advance the scrollbar width in various browsers, browser versions and even browser themes. 

The scrollbar width is and should be fundamentally under the full control of the user; it is definitely an accessibility issue that belongs to the user. I personally use Linux KDE and can (and I have in fact) configure such width. A scrollbar width of 15px is too narrow for me; I've set it to 19px and then to 21px for easier control, confort.

Gérard
Comment 17 rasamassen 2011-12-29 07:29:32 PST
Per http://www.w3.org/TR/css3-box/#overflow0, overflow applies to "non-replaced block-level elements and non-replaced ‘inline-block’ elements" (meaning it doesn't apply to img, object, and the like). A block-level box includes "all table boxes" (like table-row-group and table-column-group). Thus, overflow applies to all table boxes, including <tbody>.

Though no browser currently implements an overflow:scroll ability (tested Chr16, FF9, IE9, O11.6), a table with a <tbody> and a <colgroup> should be able to use CSS3 to create a frozen panes effect.
Comment 18 Karl Dubost 2024-01-22 22:00:59 PST
rdar://3478312
Comment 19 Karl Dubost 2024-01-23 00:20:45 PST
None of the browsers implements this. 
https://codepen.io/webcompat/pen/bGZrqPm

Though it's a very frequent question on stack overflow and articles.