Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

Adding a background Picture to a table

To add a background picture to cells in a table, use the background attribute in the <table> or <td> tags. Internet Explorer does recognise a background picture added to a <tr> tag although I think Netscape does.

The following example shows how to add a background picture to a table cell:

<table border="0">
<tr>
<td background="stars.gif" width="482" height="169">
<p align="center"><font size="+2" color="#FFFFFF">
Space, the final frontier.............</font>
</td>
</tr>
</table>

This displays as:

Just to complicate life, Internet Explorer and Netscape handle background pictures completely differently. If you add the background picture to the whole table, Internet Explorer tiles the graphic to fit in the table but Netscape Navigator repeats the graphic in each cell.

If the graphic is too big to fit in the table, the browser clips it to fit.