Why Table Layout in GWT?

254 views
Skip to first unread message

Mohammed Sameen

unread,
Dec 9, 2014, 2:20:41 AM12/9/14
to google-we...@googlegroups.com
Hi,
 Why table layout is used in GWT?Why not div layout?

Thomas Broyer

unread,
Dec 9, 2014, 4:35:59 AM12/9/14
to google-we...@googlegroups.com


On Tuesday, December 9, 2014 8:20:41 AM UTC+1, Mohammed Sameen wrote:
Hi,
 Why table layout is used in GWT?Why not div layout?

Only old widgets use "table layout", and they do so because at the time they were written (years ago) it was the only reliable way of laying out things cross-browser.
Newer widgets don't use "table layout".
I'd go as far as saying that if you use a widget that relies on "table layout" today, You're Doing It Wrong™. Modern GWT apps should rely mostly on FlowPanel and HTMLPanel (and the various "layout panels" for complex layouts), you shouldn't need HorizontalPanel, VerticalPanel and the like.

Ltearno

unread,
Dec 9, 2014, 7:23:24 AM12/9/14
to google-we...@googlegroups.com
Sometimes table layout is just the only option...

If you are really annoyed seeing <table> elements, you can use a div with a display attribute to table for example... ( <div style="display:table"> )

Joel Handwell

unread,
Dec 11, 2014, 8:53:31 PM12/11/14
to google-we...@googlegroups.com
Is deprecation considered to be scheduled on those table layout widgets?

Gilberto

unread,
Dec 12, 2014, 2:05:54 PM12/12/14
to google-we...@googlegroups.com
Ok, I won't start another "table vs. tableless layout" war. There are a lot of resources about it on the web.

My point here is simple: if the developer wants to use table layout, for whatever reason, at least the table should behave as expected according to the W3C recomendations, which states:

If a table is to be used for layout it must be marked with the attribute role="presentation" for a user agent to properly represent the table to an assistive technology and to properly convey the intent of the author to tools that wish to extract tabular data from the document.

Source: http://www.w3.org/TR/html5/tabular-data.html#the-table-element

In other words, tables for layout should be marked as such. Table layout widgets should consider this.
Reply all
Reply to author
Forward
0 new messages