We call this "hints" because we don't intend to show you all the information you need to create tables. Instead, this section is intended to get you thinking about how tables are constructed in general. Once you understand this, we feel that you can best learn the details by looking at examples.
<table> <tr><td> </td><td> </td><td> </td></tr> <tr><td> </td><td> </td><td> </td></tr> <tr><td> </td><td> </td><td> </td></tr> </table> |
It may look a little intimidating, at first. You'll soon see that it is pretty straight forward.
There are a few things to look at that are more apparent in this simple table than the more complex one's you'll see soon.
What does this table look like? Actually, nothing. You can't see it because it has no data and until we add some more information, there won't be any lines.
|
|
There are three values, including border, that you can use to enhance the appearance of your tables.
border border=0 border=5 |
This draws lines of various thicknesses around the table, or lets you turn all the table lines off. Note that the outer line has been defined as a bezel and it gives the table a distinct 3D appearance. |
cellpadding=0 cellpadding=5 |
This controls the width of the interior lines in the table. Bigger values result in thicker lines. The values are in pixels. |
cellspacing=0 cellspacing=10 |
This is the space (in pixels) around each item in a data cell. |
You can see how these work with a few examples. The previous table will be used, except it will have different beginning <table> container enhancements.
|
|
|
|
|
|
|
|
|
|
There are many useful enhancements that can be added to containers.
horizontal alignment options, both for the table as a whole and for cell contents. | |
vertical alignment options for cell contents. | |
size options, expressed as either an absolute value (such as the number of pixels) or a percentage. | |
grouping of cells so that larger cells can span either rows or columns. |
numbers since data values are a key part of many tables. | |
words for both identification (like column headers) as well as "data values." Sometimes people put many paragraphs of words into a single cell when a table is used to format a page. You can use all the word formatting containers (such as <b> and <i> to get bold and italics, as well as <br> and <p> to control line breaks. | |
images such as icons, or even pictures. Sometimes large pictures are included. An image can be sized to fit into a cell. You'll see in the examples that you can even expand a tiny image to make a line or fat bar. | |
links to send people to other places. | |
rules, which provide any easy and general way you can get lines into a table. | |
tables can be put into tables (doesn't that boggle the mind!). |
Some of these possibilities may seem unlikely. Don't bet on it. Everything on this list has been used somewhere on this page or the TABLES home page.
Check out the examples. We strongly believe that you learn best by finding an example of something that interests you and then examining how it was created. You'll find a lot of tables, the code that was used to create them and our commentary on the process. |