Does a table row (
If you have a As others have noted, It sounds like you might be creating something like a calendar, where you're wanting to have alternating rows of Alternatively, you might want to consider whether the data can be organized in multiple tables, or if an alternative version can be provided that would be easier to use for screen reader users. For example, an events calendar could additionally be presented as a list of events. ) have to be in a table body ( ), if the table has a table body, or can it exist outside of the table body?
outside of a , the page will not validate:
http://validator.w3.org
is optional unless you're using
or
. The main reason to use the latter two elements is so the header and footer are repeated on each page if a long table is printed.
(e.g., for dates) and (e.g., for events on that date). If that's the case, you shouldn't wrap the alternating rows in and
- doing so would confuse the heck out of browsers when it came to printing the page. If you just leave the grouping elements out, your table will validate. However, some screen readers might be confused by that markup and apply the top-most row of headers to all cells beneath them. For a complex table such as this, you'll need to add additional markup to assure that screen readers understand how the table is organized. Here's your table with accessible markup:
...
...
...
...
...
...