TablesTables are extremely useful to use throughout your webpage, especially if you have a lot of text. An example of what a table would look like is this:
Tables are just for better organization and can be used to show comparisons with data. The table tag always goes inside the body tag. There are four main tags that go into a table. Here they are:
There are some properties of the table that I will cover right now. I will cover three properties, the border, cell spacing, and the cell padding. Remeber how the color and size attributes of text go inside the font tag? The border, cell spacing, and cell padding similarly go inside the table tag. BorderThe border property of a table is to put a border around the table. To customize the border property, just do this: <table border="5"></table> This would make a table with a border of 5. You can adjust the number after cellpadding= to any number that will fit you standards. If you dont want to have a table without lines like this:
you should probably use the border property. The border is the same as with pictures and graphics. Its just that this time, it doesn't go around a picture but a table. Cell PaddingCell padding is the amount of area that is inside each cell. If you just want some room in each cell, use the cell padding property. The cell padding property works the same as the border property. It goes in the same place. The code would look like this: <table cellpadding="5"></table> The number after the cellpadding= is amount of cellpadding there will be. Customize the number in any way to fit your needs. Cell SpacingCell spacing is the space in between the cells in the table. This property works very similarly as the border and cellpadding properties. The code would look like this: <table cellspacing="5"></table> The number after cellspacing= is the amount of cellspacing there will be. Customize the number to fit your wants. TR and TDRemeber that the <tr> and <td> tags go inside the <table> tag. Also remeber that the <td> tag goes in side the <tr> tag. The following just shows an example of a table and the ***'s just stand for the code of each cell: <table> <tr> <td>***</td> </tr> </table> Do you remeber the countries of the world table before that looks like this:
The code is actually very simple. Take a look:
Now wasn't that easy? We will continue tables in our next chapter. We will cover tables and images and other cool things. So come on in to Tables, Continued |