Jump to Real's How-to Main page

Use an Image as table cell background

<STYLE style="text/css">
td.special { 
    background-image: url('../images/line.gif');
    background-repeat: repeat-x;
    background-position: center;
}
</STYLE>

<TABLE border=0>
<TR><TD >line 1 line 1 line 1 line 1 line 1 line 1 line 1</TD></TR>
<TR><TD class='special'>
    line 2 line 2 line 2 line 2 line 2 line 2 line 2</TD></TR>
<TR><TD >line 3 line 3 line 3 line 3 line 3 line 3 line 3</TD></TR>
</TABLE>

The output :
line 1 line 1 line 1 line 1 line 1 line 1 line 1
line 2 line 2 line 2 line 2 line 2 line 2 line 2
line 3 line 3 line 3 line 3 line 3 line 3 line 3


If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]