Objectives: Index | Definitions| Previous | Next |
Making Tables
- Make a simple table.
- Use table to format images, text, etc.
Tables are useful for organizing items and putting them where you want them on the page. Look at this example while reading the html script below.
- Notice the various attributes you can put into the <table> tag.
You can give the width of a cell or table either in % or in pixels.
- <tr> starts a row.
- <td> starts a cell.
- <valign> aligns text in a cell vertically.
- <center> is needed to center text horizontally in a cell.
- Don't forget to close each cell (</td>), each row (</tr>), and the table (</table>).
Title 1a 1b 1c 2-3a 2b 2c 3b 3c
<table border=2 cellspacing=0 cellpadding=10 width=420> <tr>
<td colspan=3 valign=top>
<b>Title</B>
</td>
</tr>
<tr>
<td width=33% valign=top> <center> 1a </td>
<td width=33% valign=top> <center> 1b </td>
<td width=33% valign=top> <center> 1c </td>
</tr><tr>
<td rowspan=2> <center> 2-3a</td>
<td> <center> 2b</td>
<td> <center> 2c</td>
</tr>
<tr>
<td> <center> 3b</td>
<td> <center> 3c</td>
</tr>
</table>
Now, make a simple table (perhaps not using colspan and rowspan).
- Try different cellspacing, cellpadding, and borders.
- Use a table to place an image and text.
Project Contact: Andria Erzberger
Last Update: January 21, 2003