background-image: url(***);

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

The background-image property specifies the background image of an element.

The background image of the cells can be specified by applying this property to the TABLE, TR, TD or TH elements.


table {
background-image: url(image/back.gif);
}

Property Value Explanation
background-image url(URL) the URL of the image to display

The default is "none".

The background-repeat and background-position properties can be specified at the same time.

The display examples

When you apply this property to the TABLE element.

table { background-image: url(image/back.gif); }

Cell A Cell B
Cell C Cell D

When you apply this property to the TR element.

tr.example { background-image: url(image/back.gif); }

Cell A Cell B
Cell C Cell D

When you apply this property to the TD (TH) element.

td.example { background-image: url(image/back.gif); }

Cell A Cell B
Cell C Cell D

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

table, th, td {
border: 2px #2b2b2b solid;
color: #2b2b2b;
}

table {
background-color: #d9ffd9;
background-image: url(image/back.gif);
}

</style>

</head>
<body>

<table>
<tr>
<th>Heading A</th>
<th>Heading B</th>
<th>Heading C</th>
</tr>
<tr>
<td>Cell A</td>
<td>Cell B</td>
<td>Cell C</td>
</tr>
<tr>
<td>Cell D</td>
<td>Cell E</td>
<td>Cell F</td>
</tr>
</table>

</body>
</html>

Output
Heading A Heading B Heading C
Cell A Cell B Cell C
Cell D Cell E Cell F