Thursday 28 November 2013

Using Table as layout in HTML 5

The HTML5 specification still recommends that you don't use tables for layout, but if you do, you should differentiate those tables from tables that are used for tabular data.

Features to Define Your Table as Layout or Non-Layout

Feature of Table Is a Layout Table?
<table role="presentation"> It probably is a layout table
<table border="0"> It probably is a layout table
<table cellpadding="0"> It probably is a layout table
<table cellspacing="0"> It probably is a layout table
Use of the CAPTION, THEAD, or TH elements It probably is not a layout table
Use of the headers and scope attributes on the TH element It probably is not a layout table
<table border=""> It probably is not a layout table
<table border="1"> It probably is not a layout table
Visible borders set with CSS It probably is not a layout table

No comments:

Post a Comment