Page 1 of 1

xhtml/css validation error

Posted: Mon Nov 15, 2004 10:18 pm
by C_Calav
can anyone tell me why this is?
Line 195, column 22: document type does not allow element "table" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

<table width = "190px">
thanx

Posted: Tue Nov 16, 2004 3:08 am
by phpScott
what does the rest of the code look like, xhtml is context sensitive so one line doesn't help us much

Posted: Tue Nov 16, 2004 9:11 pm
by C_Calav
sorry i thought i edited that when i first posted. something musta happened...

Code: Select all

<table width = "190px">
	<tr>
		<td colspan="2"><strong>Suscribe to our mailing list:</strong></td>
	</tr>
	<tr>
		<td valign="middle" >Name:</td>
		<td><input type="text" name="E_Name" class="maillist"/></td>
	</tr>
	<tr>
		<td>Email:</td>
		<td><input type="text" name="E_Email" class="maillist"/></td>
	</tr>
	<tr>
		<td>Country:</td>
		<td> <select name="E_Country">
                      <option value="Select your County">Select your Country</option>
                      <option value="DZ">Algeria</option> 
                      <option value="AS">American Samoa</option> 
                      <option value="AD">Andorra</option> 
                      <option value="AI">Anguilla</option> 
                      <option value="AQ">Antarctica</option> 
                      <option value="AG">Antigua and Barbuda</option> 
                      <option value="AR">Argentina</option> 
                      <option value="AW">Aruba</option> 
                      <option value="AU">Australia</option> 
							  <option value="ZR">Zaire</option> 
                      <option value="ZM">Zambia</option> 
                      <option value="ZW">Zimbabwe</option> 
                    </select></td>
	</tr>
	<tr>
		<td colspan="2"><input type="submit" name="mailSend" value="Send" class="button"/></td>
	</tr>
</table>

copy paste

Posted: Wed Nov 17, 2004 3:03 am
by phpScott
I copied and pasted your code into xml spy and validated it and it says it was fine.

here is the full code.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Enter the title of your XHTML document here</title>
	</head>
	<body>
		<table width = "190px">
   <tr>
      <td colspan="2"><strong>Suscribe to our mailing list:</strong></td>
   </tr>
   <tr>
      <td valign="middle" >Name:</td>
      <td><input type="text" name="E_Name" class="maillist"/></td>
   </tr>
   <tr>
      <td>Email:</td>
      <td><input type="text" name="E_Email" class="maillist"/></td>
   </tr>
   <tr>
      <td>Country:</td>
      <td> <select name="E_Country">
                      <option value="Select your County">Select your Country</option>
                      <option value="DZ">Algeria</option>
                      <option value="AS">American Samoa</option>
                      <option value="AD">Andorra</option>
                      <option value="AI">Anguilla</option>
                      <option value="AQ">Antarctica</option>
                      <option value="AG">Antigua and Barbuda</option>
                      <option value="AR">Argentina</option>
                      <option value="AW">Aruba</option>
                      <option value="AU">Australia</option>
                       <option value="ZR">Zaire</option>
                      <option value="ZM">Zambia</option>
                      <option value="ZW">Zimbabwe</option>
                    </select></td>
   </tr>
   <tr>
      <td colspan="2"><input type="submit" name="mailSend" value="Send" class="button"/></td>
   </tr>
</table>
	</body>
</html>
is there any thing else around the code that could be causing trouble?

Posted: Wed Nov 17, 2004 4:37 am
by C_Calav
hi phpScott, thanx for that. when i use the http://validator.w3.org/ validator i get no errors but that one about the table. could be something wrong but i cant spot it because of the no errors things.

http://www.modelaircraft.co.nz/index.php this is the page i am validating.

Posted: Wed Nov 17, 2004 5:03 am
by timvw
you have <p> <table> and are using xhtml1.0

http://www.w3.org/TR/2003/WD-xhtml2-200 ... ock-text_p

Posted: Wed Nov 17, 2004 5:05 am
by phpScott
I did get the code and tried to validate it but your right the <table> seemed a problem.
I changed the preceeding <p> tag to a <div> tag and it validated fine.
I'm not 100% sure but I don't thing you can use <p> to apply a style to a table as <p> has it's own subtle meaning for formatting of text.

try and see what happens.

BTW you style sheet positioning in firefox is off as there is overlapping.

Otherwise the site looks good and should be intersting next time in NZ visiting family I will have to check it out.

Posted: Wed Nov 17, 2004 2:27 pm
by C_Calav
thanx guys for your help! did not know that! so basically do not use <p> tags around a table?

phpScott, was getting to browser accability when fixed up errors. how do i go about seeing if the site works across alot of browsers? download all the popular ones and test?

and also how would i go about tweaking the site to display on all browsers?
fixing a problem for one browser might create other problems on other browsers?

any help would be great as i am about to embark into the unknowen for myself!

Posted: Thu Nov 18, 2004 3:28 am
by phpScott
Yes download and run is the way I do it, I have firefox, IE, Netscape which will cover most of the market.

Is far as cross browser support for css I find one on the web I like try it and slowly and carefully modify it.
I curse, grumbley and bang my head against the keyboard and realize that I don't know any where's enough about css to be able to make one cross browser compatible with any thing more then simple scripts.

Sorry.

Posted: Thu Nov 18, 2004 3:32 am
by timvw
C_Calav wrote:thanx guys for your help! did not know that! so basically do not use <p> tags around a table?
OR make your documents xhtml2 instead of xhtml1

Posted: Thu Nov 18, 2004 5:22 am
by C_Calav
thanx guys. cheers timvw will look into it tommorow. and will get those other browsers to test out. heard thats the best way

Posted: Tue Nov 30, 2004 8:40 pm
by rehfeld
i dont think <p> tags can have any block level elements inside of it. only inline

this is why you cant have a <ul> or <ol> inside a <p> tag, theyre block level.

<div> inside a <p> is a no-no as well and so on...