background image


<table background=""><tr background=""><td background="">

Browser
Internet Explorer Firefox Opera
Type
Extension

The background attribute of the TABLE, TR, and TD (TH) elements specifies the background image of the table.


<table background="back.gif"> : Applied to an entire table. Internet ExplorerFirefoxOpera

<tr background="back.gif"> : Applied to all cells in a row. FirefoxOpera

<td background="back.gif"> : Applied to one cell. Internet ExplorerFirefoxOpera


Attribute Value Explanation
background=" " URL the URL of the image to display

Extension attribute. (Non standard attribute)

Tips and Notes

Use CSS instead of this attribute. Please see the "Related Document" for details on CSS.


Example

Background image Background image


Background image of the table

<table border="1" background="image/back.gif">
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
<tr>
<td>Row3 - Col1</td>
<td>Row3 - Col2</td>
<td>Row3 - Col3</td>
</tr>
</table>
Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
Row3 - Col1 Row3 - Col2 Row3 - Col3

Background image of the row

<table border="1">
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr background="image/back.gif">
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
<tr>
<td>Row3 - Col1</td>
<td>Row3 - Col2</td>
<td>Row3 - Col3</td>
</tr>
</table>
Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
Row3 - Col1 Row3 - Col2 Row3 - Col3

Background image of the cells

<table border="1">
<tr>
<td>Row1 - Col1</td>
<td background="image/back.gif">Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
<tr>
<td>Row2 - Col1</td>
<td background="image/back.gif">Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>
<tr>
<td>Row3 - Col1</td>
<td background="image/back.gif">Row3 - Col2</td>
<td>Row3 - Col3</td>
</tr>
</table>
Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3
Row3 - Col1 Row3 - Col2 Row3 - Col3