Table XHTML tag


Tables Transitional   Strict
<table ></table> tags example tags example
Must contain in opening tag summary=""













______________
<caption></caption> 
[for 508]
<table summary="products">
<tbody>

<tr>
<td>&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td ></td>
<td >&nbsp;</td>
</tr>
</tbody>
</table>

______________
<table>
<tbody>
<caption>products</caption>
<tr>
<td>&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td ></td>
<td >&nbsp;</td>
</tr>
</tbody>
</table>
As Transitional













______________
As Transitional







----------------------
Must not contain in opening tag  name=""

______________

align="justify"

There is no justify attribute with tables 


______________
<table name="test"></table>

______________

<table align="justify" >
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>
______________
As Transitional

______________

There is no justify attribute for main tables with strict , bit you can have it with cells
______________

width=""

There is no width attribute with tables in strict, this applies to the table and cells






______________

There is no align attribute with tables in strict

align="left"
align="center"
align="right"
align="justify"


______________







______________


<table width="100%">
<tr>
<td width="50%">&nbsp;</td>
<td width="50%">&nbsp;</td>
</tr>
</table>

______________


<table align="right">
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>
Can contain in opening tag border=""





__________________

id=""





__________________

align="left"
align="center"
align="right"




__________________
TABLE WIDTH  percentage [%]


width="%"




Pass Transitional  Validation


__________________
TABLE WIDTH  - pixels 

width=""

Note: 
you do Not add "px" 
after the amount

e.g. [width="50px"]
<table border="1">
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>
__________________

<table id="bluetable" >
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>
__________________

<table align="right" >
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>

__________________
TABLE WIDTH  percentage [%]


<table width="100%">
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>


__________________
TABLE WIDTH  - pixels

<table width="500">
<tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
</table>


As Transitional





______________
As Transitional






______________

Table align will
Fail Strict Validation





______________
Table width will
Fail Strict Validation










______________
Table width will
Fail Strict Validation










Must contain between tags <tbody>
<tr> </tr>,
<td></td>
<caption> (required for 508)
<table>
<tbody>
<caption>products</caption>
<tr>
<td>&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td ></td>
<td >&nbsp;</td>
</tr>
</tbody>
</table>
As Transitional  
Can contain between tags <tbody,
<th>
<tfoot>
<table border = "1">
<thead>
<tr>
<td>This text is in the THEAD</td>
</tr>
</thead>
<tfoot>
<tr>
<td>This text is in the TFOOT</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>This text is in the TBODY</td> 
</tr>
</tbody>
</table>

This text is in the THEAD
This text is in the TFOOT
This text is in the TBODY
As Transitional  
Must not contain between tags <div>    As Transitional  
Must not be contained in <h1-6>, <p>, <ul, <ol>   As Transitional  
Can be contained in <div>   As Transitional  

 

th   th is for header cells, td for data, but for cells acting as both use td.
tfoot  Table Footer Use tfoot to duplicate footers when breaking table across page boundaries, or for static footers when tbody sections are rendered in scrolling panel.
tbody Table Body Use multiple tbody sections when rules are needed between groups of table rows.
tr Table Row Use thead to duplicate headers when breaking table across page boundaries, or for static headers when tbody sections are rendered in scrolling panel.
col Table Column col elements define the alignment properties for cells in one or more columns.
colgroup Table Column Group colgroup groups a set of col elements. It allows you to group several semantically-related columns together.