[html5] sections and tables

Ian Hickson ian at hixie.ch
Fri Mar 4 16:16:58 PST 2011


On Fri, 10 Dec 2010, webmaster wrote:
> On 12/7/10 3:07 PM, Ricardo Tomasi wrote:
> > 
> > 2010/12/6 webmaster <webmaster at tsmchughs.com
> > <mailto:webmaster at tsmchughs.com>>
> > 
> > > <table>s cannot contain <section>s, and <tbody> does not participate
> > > in the document outline. So if I have a <table>, am I stuck using
> > > <h2> or <h3> or...? Is there anyway to use <h1> as I do in sections
> > > and have the outline work correctly?
> > 
> > In my understanding, nothing inside a table should need to appear in
> > the outline. Tables are for tabular data
> 
> Consider this table:
> 
> http://www.tenmercer.com/menu/dinner
> 
> It's tabular data. Each <tbody> represents a different section of the 
> table. Each has a subheading <h2>. In other pages of this site, as I 
> update them to html5, I've been replacing <h2> with <h1> and putting the 
> heading and its related content inside a <section> element. But I cannot 
> do that with this (or with other, similar, tables). Any suggestions?

<table>
 <tbody>
  <tr>
   <th scope="rowgroup">appetizers
  ...
  <tr>
   <th scope="row">Lobster Bisque
   <td>chopped Maine lobster...
   <td>$8
  ...
 <tbody>
  <tr>
   <th scope="rowgroup">sides
  ...

etc.

No need for sections, just treat it as one big table. Table headers can be 
given the semantics to make this work quite easily.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list