xhtml/css validation error

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

xhtml/css validation error

Post 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
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

what does the rest of the code look like, xhtml is context sensitive so one line doesn't help us much
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post 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>
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

copy paste

Post 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?
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

you have <p> <table> and are using xhtml1.0

http://www.w3.org/TR/2003/WD-xhtml2-200 ... ock-text_p
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post 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.
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post 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!
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post 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
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post 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...
Post Reply