Forum Moderators: phranque

Message Too Old, No Replies

Tables, XHTML and PHP

Help needed to validate page

         

medaci

1:07 pm on Jul 5, 2005 (gmt 0)

10+ Year Member



I am trying to validate a page with XHTML 1.0 Transitional and am having problems with table set in PHP
the error message coming up is

document type does not allow element "table" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

the actual line of code is

echo "<table width=\"550\" align=\"center\" cellpadding=\"2\" border =\"1\" bgcolor=\"#ecf2f9\" class=\"MatchDetails\">";

I have tried putting everything except the table tag in the css and not had any joy.

This problem only happens on the pages with php in them , plain XHTML pages have validated without any problems, well, nothing that couldn't be corrected. :)

If anyone has any suggestions I would be grateful.

Thanks

Medaci.

mattur

10:39 am on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like your php script is emitting invalid code somewhere else - e.g. not closing a tag that appears before the table tag.

Check the output of your php script. This thread may be of use in tracking down the problem:
[webmasterworld.com...]

medaci

3:13 pm on Jul 7, 2005 (gmt 0)

10+ Year Member



Hi,

Having just spent a good half hour writing a reply showing all the various code, source and browser, I came across a <p> just outside my PHP code and removed it for neatness sake, and yes you guessed it the damn think went and validated. YIPPEE!

Just wish I'd found it sooner.

Still that's my lesson learnt for today,

Don't put a paragraph tag outside your PHP code or it won't validate.

Hhmm lesson well learnt methinks.

Thanks

Medaci