| |
| Web Hosting |
|
|
|
| |
Tables |
|
| |
|
|
| |
Table tags are the most used HTML tags by Web Designers. This page introduces you to tables.
The following list shows the main tags used within tables.
- <table> and </table>: These tags signify the beginning and the end of the table.
- <tr> and </tr>: These tags signify the beginning and the end of a row within the table
- <td> and </td>: These tags signify the beginning and the end of a table column.
The image below shows an example table that contains three (3) rows and three (3) columns.
You can see the code below for the table shown in the image above.
<table width="100%" border"1" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
As you can see the table column tags (<td> and </td>) are contained within the table row (<tr> and </tr>) tags.
You will notice within the <table> tag there is attributes added. The border attribute apply's a border around your rows and columns. The cellspacing and the cellpadding add some spacing in between
your columns and rows.
You can also apply a "class" attribute to any of the tags used for tables. You can learn more about this attribute in the CSS Stylesheet tutorial.
There is a width and a height attributes that you can add to all of the commands. I always
recommend using percentages for your width. This way you can use the full 100% of a person’s
browser window but be careful with table rows and columns. If you just have one image contained in the column, it could appear over-stretched to people on higher screen resoultions.
|
|
| |
|
|
|