|
Sections: Introduction | Section 1 | Section 2 | Section 3 |
Section Three: Part A | Part B | Part C | Part D | Part E | Part F |
Table Attributes The border="" AttributeYou just learned that in order to have a border listed around the rows and data cells of your table, you must use the border="" attribute. The border="" attribute is placed in the opening <table> tag and the value of the border="" attribute can be 0 or any positive whole number. The border="" attribute's values correlate to pixel values, so if border="1" was added to a <table> tag, it would generate a border of 1 pixel width around all rows and data cells within the table. If you do not add the border attribute to the <table> tag, or if you specify the border="" attribute's value as 0, the table will not have a border. Let's See it in Action: The border="" AttributeThe code to add a 1 pixel border to all rows and data cells within a table reads as: You can play around with border widths to see how it changes the look of your table. The bgcolor=""AttributeLooking back at the table previous presented, you can see that it is lacking in the color department. Sometimes you may want to add color to an entire table or to parts of the table (rows or data cells). To achieve the desired result, you would add the bgcolor="" attribute, where bgcolor stands for background color. The value of the bgcolor="" attribute can be speicified two different ways; it can be listed as:
See the following Color Chart for a list of common color names and their associated hexadecimal color code. The bgcolor="" attribute can be added to any of the tags presented to the following tags:
Extend Your UnderstandingWhat 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. |