Tables are a significant part of HTML. It provides a way to position things on the web page. The fact tables are used may not be apparent.
<table> starts and ends the table. Within the table there are Table Rows which are started and ended with the <tr> tag. Each row contains Data cells, Table Data areas are started and ended with <td> tags.
A table may contain only one Row and one Data cell. Here is an example:
<table align="center"<tr><td> This table will <br>have five lines. <br>I purposely made <br>them quite <br>short. </td></tr></table> |
At the left is a sample of the Source for a table. Notice the
"attribute in the <table> tag. It will specify the position
where the table will appear.
Right after this paragraph I will put in
<hr> followed by
<br clear="all"> so it will be below everything else.
I will now let it execute.
|
This table will
have five lines. I purposely made them quite short. |
The table you see above was created with the seven lines shown above in a green background. It contains one of each of the tags. Technically, it has only one data cell. The only attribute in any of the tags was the one to center it. To the casual observer it doesn't look like a table. There are no borders, and the default back ground color is that of the surroundings. To get those you need more attributes.
I created the greenish table above and put it to the left of the
page by putting it in a table whose first line was:
<table align="left" bgcolor=#80ffc0><tr><td>
If you haven't done so, I suggest you change the size of the
window you are looking at to see how your browser adjusts. I think
you will be favorably impressed.
The "table" tag can have any of several attributes including:
The amount of empty space between the outer edges of each table cell. If you set the border attribute of the table element to any positive integer value, the effect of setting cellspacing is to define the thickness of borders rendered between cells. Even without a visible border, the readability of a table often benefits from cell spacing.
I need to experiment more with this one.
The above attributes are valid for all browsers. As browsers have evolved, new attributes have been added by various vendors. I try to only use features supported by: Netscape, Internet Explorer, and the "World Wide Web Consortium" (W3C) recommendations for HTML at the end of 1997.
The <tr> and <td> tags may each have a bgcolor to specify different colors to Rows and/or individual cells.
| Go to: My Home Page |
![]() |
Go to: This page TOP |