Tables (Part 1)

Tables are made up of three types of commands: TABLE (to start the table), TR (to start a table row), and TD (to start a table data cell). And remember, what you start you must finish, using the </table> or </tr> or </td> tag.

<table border=1>
<tr>
<td>
A is for apple.</td>
<td>
B</td>
</tr>
<tr>
<td>
C</td>
<td>
D is for dog.</td>
</tr>
</table>

The code above will result in the following table:


A is for apple. B
C D is for dog.

You can change the look of your cells by adding codes to your <table> and <td> tags. <table cellpadding=10> will give you more room between your text and the sides of the cell. <td valign=top align=center> will make your text aligned vertically with the top of the table cell, and horizontally it will be centered.

Example:

Hello. Here is an example. You can see that this cell looks different from the next one.This one is right-aligned and on the bottom.

Here’s a collection of most of the common table tags with examples: More than you need to know about tables.


Home | Assignments | Day-by-Day | Resources | Syllabus | Weekly

Web Development