|
Sections: Introduction | Section 1 | Section 2 | Section 3 | Section 4 | Section 5 |
Section Five: Part A | Part B | Part C | Part D | Part E |
New Attributes Stop and ThinkConsider the table created on the previous page. Did it have a border? It did. When creating a table, if you want the cells and rows of the table to have a border, you must specify that with an attribute: the border="" attribute. The border="" AttributeOne attribute that goes in the <table> tag is the border="" attribute. If you do not add the border attribute to the <table> tag, the table will not have a border. If you want to add a border to the rows and cells of your table you need to add the border="" attribute to your opening <table> tag. The border attribute value of the html table presented on the previous page was set to 1. The code to create the effect reads: You can play around with border widths to see how it changes the look of your table.The bgcolor=""AttributeLooking at the table on the previous page you can see it is a little lacking in the color department. Sometimes you may want to add color to your entire table or to parts of the table (rows or data cells). To achieve the desired result you could add the bgcolor="" attribute, where bgcolor stands for background color. The bgcolor="" attriute can be added to any of the tags presented in this lesson; as described below.
The bgcolor="" attribute will accept two different values:
Extend Your LearningWhat do you think would happen if you added the bgcolor="" attribute to the opening <body> tag? Try it and see. |
© 2008 KCDL. All rights reserved. |