|
HTML Tables
Tables are an integral part of any well designed website, providing structured
ways to display data. Tables can be edited and manipulated in many ways to make
them look appealing and stylish, and they can also be heavily modified using
css (Cascading style sheets) Below is the basic make-up of how an HTML table is setup. The next page of this tutorial will explain more of the syntax and coding in detail, but this is an example of the typical structure a HTML table will feature.
<table border="1"> - The opening table tag and border attribute declaration.
<th>Heading 1</th> - The heading for the first column (left hand side)
<th>Heading 2</th> - The heading for the second column (right hand side)
<tr> - The start of the first row
<td>Content 1</td> - the first cell, where our text/content will be
<td>Content 2</td> - the second cell, where the text/content will be
</tr> - Indicate the end of a row.
</table> - Indicate the end of the table
The code above will produce the following output. (* Output varies depending on browser defaults)
Ok, lets look at the attributes that make up the core attributes of a table, namely table, tr and td. Table attributes can be defined "inline" (i.e. within the table tag itself, as name/value pairs) or alternatively within a stylesheet. The following inline attributes can be applied to tables in order to change the way they look and behave on the page. This is not an exhaustive list, but lists the most common attributes that you are most likely to use. Common attributes for <TABLE>:
Common attributes for <TR> (Table Row):
Common attributes for <TD> (Table Data Cell):
Go to: Next page >>> | Top | Home Remember, if you get stuck or need to ask any questions, register with the forums and tell us about it! |
|