Making A Table
We’re talking here tables for holding data not the dinner table. Tables are useful in laying out the design of web pages so it’s well worth the time to learn how to make them. A table starts and ends with the table tag:It stands for“table row”and will make up one row across the table. Between the tr tags are found the td tags:
The td stands for“table data”it forms one box called a“cell”which contains content seen on the web page such as text or graphics. Here’s how the table code is put together:
Putting aborder attribute in the table tag will help you see how the table and cells are formed, setting the border attribute to"0"will remove the borders altogether. Take a close look at the code, this table will have 2 rows with 2 cells in each row. The stuff between the opening and closing td tags is what will be in each cell. Note that each row is finished off with the closing tr tag. Finally the table is finished by ending it with the closing table tag. Result:
Result 1 | Result 2 |
Result 3 | Result 4 |
We can make a table larger by putting the style attribute into the opening table tag and giving it a CSS width command:
Result:
Result 1 | Result 2 |
Result 3 | Result 4 |
Let's change the color of a cell with CSS background command:
And that folks is how a table is put together. By now you have all the tags you need to put together a website, I hope you enjoyed the lessons enough to buy my book, HTML Made Easy with a free bonus CSS tutorial.
0 comments:
Post a Comment