Home Tutorials Exercises About Us
�Let us be grateful to the people who make us happy; they are the charming gardeners who make our souls blossom.� (c) Marcel Proust


�It's been my experience that you can nearly always enjoy things if you make up your mind firmly that you will.� (c) L.M. Montgomery, Anne of Green Gables


�The best way to cheer yourself is to try to cheer someone else up.� (c)Mark Twain


�The worst part of success is trying to find someone who is happy for you.� (c) Bette Midler


�I think and think and think, I�ve thought myself out of happiness one million times, but never once into it.� (c) Jonathan Safran Foer


�One of the keys to happiness is a bad memory.� (c) Rita Mae Brown

Tables

There are a number of tags used in tables, and to fully get to grips with how they work is probably the most difficult area of this HTML Beginner Tutorial.

Copy the following code into the body of your document and then we will go through what each tag is doing:


<table>
    <tr>
        <td>Row 1, cell 1</td>
        <td>Row 1, cell 2</td>
        <td>Row 1, cell 3</td>
    </tr>
    <tr>
        <td>Row 2, cell 1</td>
        <td>Row 2, cell 2</td>
        <td>Row 2, cell 3</td>
    </tr>
    <tr>
        <td>Row 3, cell 1</td>
        <td>Row 3, cell 2</td>
        <td>Row 3, cell 3</td>
    </tr>
    <tr>
        <td>Row 4, cell 1</td>
        <td>Row 4, cell 2</td>
        <td>Row 4, cell 3</td>
    </tr>
</table>

The table element defines the table.

The tr element defines a table row.

The td element defines a data cell. These must be enclosed in tr tags, as shown above.

If you imagine a 3x4 table, which is 12 cells, there should be four tr elements to define the rows and three td elements within each of the rows, making a total of 12 td elements.


Attributes for Table

  • border = non-negative integer
    The thickness of the border of the table.
  • bordercolor = name of the color
    The color of your border.
  • cellpadding = non-negative integer
    Sets the amount of space between the contents of the cell and the cell wall.
  • cellspacing = non-negative integer
    Controls the space between table cells.
  • bgcolor = name of the color
    The entire color of your cell/table.
  • align = right/left/center
    The place of your table.
  • height = non-negative integer
    The height of your entire table.
  • width = non-negative integer
    The width of your entire table.
  • colspan = non-negative integer
    Merge your layers vertically.
  • rowspan = non-negative integer
    Merge your layers horizontally.

Related Pages