This is an ad.
 
Webmonkey Kids
Webmonkey Kids
Lessons
Projects
Playground
Tools

Introduction
icon Rows and Cells
Building Your First Table
Colspan
Rowspan
Alignment
Spacing and Padding
A Few More Tricks



Parents and Teachers:
Find out how your kids can use Webmonkey for Kids as a learning tool at home or in the classroom with our Planning Guide.

Send us feedback

Lesson A: Tables
Building Your First Table


o make the first basic table I showed you before, just type in this:

    <table border>

    <tr>
    <td>Cell 1</td>
    <td>Cell 2</td>
    </tr>

    <tr>
    <td>Cell 3</td>
    <td>Cell 4</td>
    </tr>

    </table>

And here's what the table will look like:

    Cell 1 Cell 2
    Cell 3 Cell 4

As you can see, the first table row encloses cells 1 and 2; the second table row encloses cells 3 and 4. Table rows always run horizontally. The contents of each cell - in this case, the words "Cell 1" or "Cell 2" - are sandwiched between the <td> and </td> tags.

In order to see the table, we added border to the table tag. This simply turns the border on. You can also specify its width by adding a number, as in <table border=5>. A lot of people will get rid of the border by typing in border=0.

Back

Next Page