<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> The Page Title Goes Here </title>
</head>
<body>
<table border="1" width="100%" cellspacing="0" cellpadding="0" summary="test table">
<tr>
<td> First </td>
<td> Second </td>
</tr>
<tr>
<td> Third </td>
<td> Fourth </td>
</tr>
</table>
</body>
</html>
The above code produces the following table with a border:
First Cell | Second Cell |
Third Cell | Fourth Cell |
Here are examples of using the cellspacing and cellpadding attributes:
<table border="1" width="300" cellspacing="10" cellpadding="0" summary="test table">
<tr>
<td>Data Item 1</td>
<td ROWSPAN="2">Data Item 2</td>
<td>Data Item 3</td>
</tr>
<tr>
<td>Data Item 4</td><td>Data Item 5</td>
</tr>
</table>
Data Item 1 | Data Item 2 | Data Item 3 |
Data Item 4 | Data Item 5 |
<table border="1" width="300" cellspacing="0" cellpadding="10" summary="test table">
<tr>
<td>Data Item 1</td>
<td ROWSPAN="2">Data Item 2</td>
<td>Data Item 3</td>
</tr>
<tr>
<td>Data Item 4</td><td>Data Item 5</td>
</tr>
</table>
Data Item 1 | Data Item 2 | Data Item 3 |
Data Item 4 | Data Item 5 |
Here is a example of using the rowspan attribute. It spans over two rows.
<table border="1" width="300" cellspacing="0" cellpadding="0" summary="test table">
<tr>
<td>Data Item 1</td>
<td ROWSPAN="2">Data Item 2</td>
<td>Data Item 3</td>
</tr>
<tr>
<td>Data Item 4</td><td>Data Item 5</td>
</tr>
</table>
Data Item 1 | Data Item 2 | Data Item 3 |
Data Item 4 | Data Item 5 |
Here is a example of using the colspan attribute. It spans over two columns.
<table border="1" width="300" cellspacing="0" cellpadding="0" summary="test table">
<tr>
<td>Data Item 1</td>
<td COLSPAN="2">Data Item 2</td>
</tr>
<tr>
<td>Data Item 3</td> <td>Data Item 4</td> <td>Data Item 5</td>
</tr>
</table>
Data Item 1 | Data Item 2 | |
Data Item 3 | Data Item 4 | Data Item 5 |
© Copyright 2001,2002 Southern Twilight All rights reserved.