background attribute (table, td, th)
Sets the background picture, which will be tiled if it is smaller than the object's dimensions.
This attribute is deprecated.
Use the background style property instead: 'table {background: url(bg.jpg);}'.
JavaScript page for this attribute: background. You can find other example(s) there. |
Possible values:
String that sets the URL of the picture. It can be an absolute or relative path as well. Relative paths are relative to the base URL. The base URL is the location of the current document, but it can be overridden by the base tag.
Default: this attribute has no default value.
Example HTML code 1:
This example illustrates the use of the background attribute:
|
||||
<table id="myTable" border="1px" background="bg.jpg"> <tr> <td>Apple</td> <td>Pear</td> <td>Peach</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
Recommendation:
|
||||
<table id="myTable" border="1px" style="background-image:url(bg.gif);"> <tr> <td>Apple</td> <td>Pear</td> <td>Peach</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
Related pages:
External links:
User Contributed Comments