Basic Web Design Tutorial Part 7

A simple table

Tables let us lay out information so it looks nice and can be used to lay out your whole webpage. Some would argue that all the positioning should be done with a CSS stylesheet but I’ve found that it’s hard to get working on all browsers (IE6 is particularly foobar). So I still use tables. They’ve been around for ages and all browsers seem to know what to do with them. Here’s a simple table with 2 rows.

<html>
<body>
<h1>Example 8</h1>
<table border=”1″>
<tr>
<td>
This is row 1
</td>
</tr>
<tr>
<td>
This is row 2
</td>
</tr>
</table>
</body>
</html>

Example 8

The BORDER attribute on the table just makes the borders of the table visible. That makes it a lot easier to see what’s going on.

The TABLE tag contains two TR (table row) tags, each of which contain a TD (table data) tag. The TD contains the actual content of the table. This is pretty simple but it gets complicated quite quickly on the next example.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Leave a Comment