Basic Table

Lesson 1

Remembering that everything is placed between your opening and closing body tags, There are only 3 tags that you need to know for a table.

table, tr and td

tr = Table Row

td - Table Data

lets begin by placing our opening and closing table tags

<table>

</table>

We have to add statements to the table tag to give the browser more specific instruction on how to display the table.

For example, we have to tell it how wide to make the table. This can be done by either stating the percentage of the page that the table will occupy or entering a specific width in pixels

<table width=90%>

This table will occupy 90% of the width of your page.

<table width=700>

Since our table is not going to be the full width of th page, we need to center it

<table align=center width=700>

lets add the Table Row

They will be placed between the opening and closing table tags. This will give our table one row.

<table align=center width=90%>

<tr>

</tr>

</table>

Now we need to tell our table what we plan on putting inside the table

we'll do this by adding the Table Data

hint. It's a good idea to add a break <br> in your table data if there is nothing else there, otherwise your table will appear flat

<table align=center width=90%>

<tr>

<td><br>

</td>

</tr>

</table>

Also, the default table border width is 0. For you to be able to see your table on your browser, add a border=1 statement. The border statement can be removed later once you are pleased with the content of the table.

<table align=center width=90% border=1>

<tr>

<td><br>

</td>

</tr>

</table>

 

With this code alone, this is what your table will look  like


If your table looks like this DANCE!