PDA

View Full Version : Xhtml Table Help


tommyxv
05-28-2006, 06:15 AM
How do I set a table background to be XHTML valid??



<table width="100%" border="0" cellpadding="0" cellspacing="0" background="<A href="http://www.mysite.com/images/header.gif">[/CODE">http://www.mysite.com/images/header.gif">



I did this but it is not showing the image.



Add this to the CSS



.hdr {

background: url(http://www.mysite.com/images/header.gif;

}



And then change it to this:



<table class="hdr" width="100%" border="0" cellpadding="0" cellspacing="0">

Zachery
05-28-2006, 06:57 AM
responded at .com

KTBleeding
05-28-2006, 07:07 AM
Couple of different ways to go about this..

The way you went works, but you need to add the closing paragraph tag in the CSS.

.hdr {

background: url(http://www.mysite.com/images/header.gif);

}

Or instead of creating a separate class, you can style the table.

<table style="background: url(http://www.mysite.com/images/header.gif);" width="100%" border="0" cellpadding="0" cellspacing="0">

tommyxv
05-28-2006, 07:24 AM
Thanks for the help.