HTML Lessons
- HTML Introduction
- HTML Tags
- HTML Page Structure
- HTML Backgrounds
- HTML Formatting Text
- HTML Formatting Fonts
- HTML Headings
- HTML Entities
- HTML Line Breaks
- HTML Lists
- HTML HR- Horizontal Rule
- HTML Images
- HTML Links
- Table Introduction
- Table Rows & Columns
- Table Width
- Table Alignment
- Table Border Color
- Table Background Color
- Table Background Image
- Cell Alignment
- Cell Padding
- Cell Spacing
- Cell Spanning
|
Background Color
You can change the background color of a table or cell by inserting the
bgcolor attribute. To set the background
color of a table insert the attribute into the opening table tag.
<body>
<table border="1" bgcolor="#FF0000">
<tr>
<td>Text1</td>
<td>Text2</td>
</tr>
</table>
</body>
<body>
<table border="1" >
<tr>
<td bgcolor="#FF0000">Text1</td>
<td>Text2</td>
</tr>
</table>
</body>
|