• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 120
  • Last Modified:

Tag information for the Table <TD> Tag

During a major redesign of a client's site, I decided to go one step further and run all the pages through the w3.org SHTML validation parser. I got ALL issues cleaned up except one!

Below is what they're telling me. I can't find any documentation about the background attrib. I'd love this page to validate. Any ideas?


Below are the results of attempting to parse this document with an SGML parser.

Line 22, column 55: there is no attribute "BACKGROUND" (explain...).
    <TD align="left" valign="top" width="150" background="images/mainpage_16.gif">

0
digitalwav
Asked:
digitalwav
  • 2
  • 2
1 Solution
 
rajini_chayaCommented:
Hi,
Yes there is no background attribute for the tag <td>
you can use this attribute only for the <table> tag.
Refer http://www.w3schools.com/html/attr_td.asp

0
 
digitalwavIT Infrastructure ManagerAuthor Commented:
hmmm, then why can I put the tag on a cell in a table and the image works just for that cell? Is it a browser thing?
0
 
COBOLdinosaurCommented:
Background for the td is supported by the major browsers, but it is not part of the standard.  The validators validate to the standard, so background will always generate an error.  

The standards compliant way t do it is:

<TD align="left" valign="top" width="150" style="background-image:url(images/mainpage_16.gif)">

Cd&
0
 
digitalwavIT Infrastructure ManagerAuthor Commented:
Successfull validation is a wonderful thing!

I gave the points to COBOLdinasaur because he provided a work around that validated successfully.
0
 
COBOLdinosaurCommented:
Glad we could help.  Thanks for the A.:^)

Cd&
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now