|
Home //
HTML Index //
Important Info //
Basics //
Create Tables //
Meta Tags //
FTP //
HTML Glossary //
Site Map
|
|
Step by Step instructions for creating tables for your web pages.A table defines where you place your information. Right, left, center, top, bottom or middle.
A table can have borders so it's defined, or it can be invisible. Tables are used to make your page easier to interpret can give your
document more impact. Below, you will learn how to define your tables by adding headings, rows and columns. Example of a Table
|
<table border="4"> <tr> <th>What are tables used for?</th> </tr> <tr> <td>Tables are used to make your page easier to interpret or to make your document look better.</td> </tr> </table>
<table border="0"> <tr> <td>This table has a border of 0.</td> </tr> </table> |
<table border="3"> <tr> <td>This table has a border of 3.</td> </tr> </table> |
| Heading 1 | Heading 2 | Heading 3 | Heading 4 |
|---|---|---|---|
| Cell A | Cell B | Cell C | Cell D |
| Cell E | Cell F | Cell G | Cell H |
<table border="2"> <tr> <th>Heading 1</th><th>Heading 2</th><th>Heading 3</th><th>Heading 4</th> </tr> <tr> <td>Cell A</td> <td>Cell B</td> <td>Cell C</td> <td>Cell D</td> </tr> <tr> <td>Cell E</td> <td>Cell F</td> <td>Cell G</td> <td>Cell H</td> </tr> </table>There are many variations of how you can make your tables appear.
| Heading 1 | Heading 2 | Heading 3 | Heading 4 |
|---|---|---|---|
| Cell A | Cell B | Cell C | Cells D &. H |
| Cell E | Cell F | Cell G |
<table border="2"> <tr> <th>Heading 1</th><th>Heading 2</th><th>Heading 3</th><th>Heading 4</th> </tr> <tr> <td>Cell A</td> <td>Cell B</td> <td>Cell C</td> <td rowspan="2">Cells D & H</td> </tr> <tr> <td>Cell E</td> <td>Cell F</td> <td>Cell G</td> </tr> </table>
| Heading 1 | Heading 2 | Heading 3 | Heading 4 |
|---|---|---|---|
| Cells A & B | Cell C | Cell D | |
| Cell E | Cell F | Cell G | Cell H |
<table border="2"> <tr> <th>Heading 1</th><th>Heading 2</th><th>Heading 3</th><th>Heading 4</th> </tr> <tr> <td colspan="2">Cells A & B</td> <td>Cell C</td> <td>Cell D</td> </tr> <tr> <td>Cell E</td> <td>Cell F</td> <td>Cell G</td> <td>Cell H</td> </tr> </table>
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Cell C align="left" |
Cell A align="center" |
Cell B align="right" |
<table width="100%" border="2"> <tr> <th>Header 1</th><th>Header 2</th><th>Header 3</th> </tr> <tr> <td align="left">Cell C</td> <td align="center">Cell A</td> <td align="right">Cell B</td> </tr> </table>Take this one step further and VALIGN your cells.
| Header 1 | Header 2 | Header 3 | Header 4 |
|---|---|---|---|
| Cell A valign="bottom" |
Cell B valign="top" |
Cell C valign="middle" |
Cell D & H No alignment specified rowspan="2" |
| Cell E valign="top" |
Cell F valign="middle" |
Cell G valign="bottom" |
<table width="100%" border="2"> <tr> <th>Header 1</th><th>Header 2</th><th>Header 3</th><th>Header 4</th> </tr> <tr> <td height="60" valign="bottom">Cell A</td> <td height="60" valign="top">Cell B</td> <td height="60" valign="middle">Cell C</td> <td rowspan="2">Cell D & H</td> </tr> <tr> <td height="60" valign="top">Cell E</td> <td height="60" valign="middle">Cell F</td> <td height="60" valign="bottom">Cell G</td> </tr></table>The next step is to define the widths of your Table Cells.
| Header 1 | Header 2 | Header 3 | Header 4 | Cell A width="25%" align="left" valign="bottom" |
Cell B width="25%" align="center" valign="middle" |
Cell C width="25%" align="right" valign="top" |
Cells D & H rowspan="2" No alignment set. Most Browsers default to align="left" and valign="middle" |
|---|---|---|---|
| Cells E & F colspan="2" align="right" valign="middle" |
Cell G align="center" valign="bottom |
||
<center><table width="80%" border="2"> <tr><th>Header 1</th><th>Header 2</th><th>Header 3</th><th>Header 4</th></tr> <td width="25%" height="60" align="left" valign="bottom"><b>Cell A</b></td> <td width="25%" height="60" align="center" valign="middle"><b>Cell B</b></td> <td width="25%" height="60" align="right" valign="top"><b>Cell C</b></td> <td width="25%" rowspan="2"><b>Cells D & H</b></td> </tr> <tr> <td width="50%" colspan="2" align="right" valign="middle">Cells E & F</td> <td width="25%" height="60" align="center" valign="bottom">Cell G</td> </tr> </table></center>Adding an IMAGE
| Header 1 | Header 2 | Header 3 | Header 4 | Cell A <td width="25%" align="left" valign="bottom"> <img src="pics/rose-ico5.gif" width="56" height="42" border="0" alt="rose"> |
Cell B <td width="25%" align="center" valign="middle"> <img src="pics/rose-ico5.gif" width="56" height="42" border="0" alt="rose"> |
Cell C <td width="25%" align="right" valign="top"> <img src="pics/rose-ico5.gif" width="56" height="42" border="0" alt="rose"> |
Cells D & H <td rowspan="2"> No alignment set. Most Browsers default to align="left" and valign="middle" <img src="pics/rose-ico5.gif" width="56" height="42" border="0" alt="rose"> |
|---|---|---|---|
| Cells E & F <td colspan="2" align="right" valign="middle"> <img src="pics/rose-ico5.gif" width="56" height="42" border="0" alt="rose"> |
Cell G <td align="center" valign="bottom> <img src="pics/rose-ico5.gif" width="56" height="42" border="0" alt="rose"> |
||
|
Home //
HTML Index //
Important Info //
Basics //
Create Tables //
Meta Tags //
FTP //
HTML Glossary //
Site Map
|