Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
488
The <table> Tag (XHTML Reference)
Introduction
The <table> tag is used to create a table with rows
and cells. The table contains a body <tbody>, header <thead>, a
table row <tr>, a table data <td> and a table footer <tfoot>.
A table can be very useful if you want to show a report with a header and some
data. It can be also useful if you want to show an image with some text next to
it. But as mentioned the main aspect of tables was to show data. However in
today’s world we use the tables also for navigation bars and for page layouts
to have a cleaner structured as well as organized look.
Example
<table border="1">
<thead>
<tr>
<th>User</th>
<th>EMail</th>
<th>Permission</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sonu</td>
<td>sonu@XXXX.com</td>
<td>Admin</td>
</tr>
<tr>
<td>Mark</td>
<td>Mark@XXXX.com</td>
<td>Admin</td>
</tr>
</tbody>
<tfoot>
<tr>
<td
colspan="3"><b>2 Users found</b></td>
</tr>
<tr>
</tfoot>
</table>
Output
Attributes
Name:
Description:
align
Aligns the table with one of the following options.
left
right
center
border
Defines the thickness of the border in pixel.
bgcolor
Defines the background color of the table. The value must
be in hex form (#XXXXXX) or you can use the color name.
cellpadding
Defines the inner distance between the cells and the cells
content in pixel or percent.
cellspacing
Defines the distance between the cells in pixel or
percent.
frame
This attribute can be only used in conjunction with the
border attribute. And it defines which frames of the table should be visible
with one of the following options.
void
above
below
hsides
lhs
vsides
box
border
rules
This attribute can be only used in conjunction with the
border attribute. Defines which of the divider lines should be visible with
one of the following attributes.
none
group
rows
cols
all
summary
Defines the summary of the table for speech-synthesizing.
width
Defines the width of the table in pixel or percent.