Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-13-2011, 09:33 PM   PM User | #1
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
document type does not allow element "foo" here

I get this error several times when using the w3 validator, but I'm not sure why. Here is my code up to the first occurrence of the error:
Code:
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
      <meta name="author" content="Eric Kemp" />
      <title>xHTML Table Examples - INT222 Assignment 1 - Eric Kemp</title>
   </head>

   <body>
      <a id="top"></a>
      <table border="0" width="100%" cellpadding="10">
         <tr>
            <td bgcolor="#FFFFFF" width="200" height="50" align="center" valign="bottom">
               <img src="images/scslogo.png" alt="SCS Logo" title="SCS Logo"/>
            </td>
            <th bgcolor="#FFFFFF" width="*" valign="middle">
               xHTML Table Examples
            </th>
         </tr>

         <tr>
            <td bgcolor="#FFFFFF" align="center" valign="top">
               <hr/><a href="index.html"> <img src="images/home.png" alt="Assignment 1 Home Page" title="Assignment 1 Home Page" border="0"/> </a>
               <hr/><a href="resume.html"> <img src="images/resume.png" alt="My Resume" title="My Resume" border="0"/> </a>
               <hr/><a href="research.html"> <img src="images/research.png" alt="My Research" title="My Research" border="0"/> </a>
               <hr/><a href="tables.html"> <img src="images/tables.png" alt="xHTML Table Examples" title="xHTML Table Examples" border="0"/> </a>
               <hr/><a href="lists.html"> <img src="images/lists.png" alt="xHTML List Examples" title="xHTML List Examples" border="0"/> </a>
               <hr/><a href="contact.html"> <img src="images/contact.png" alt="Contact Me" title="Contact Me" border="0"/> </a>
               <hr/><a href="honesty.html"> <img src="images/honesty.png" alt="Honesty Policy" title="Honesty Policy" border="0"/> </a>
               <hr/><a href="../index.html"> <img src="images/zenit.png" alt="My Zenit Account" title="My Zenit Account" border="0"/> </a>
               <hr/>
            </td>
            <td bgcolor="#CCCCCC" align="center">
               <p>
                  Jump to:<br/>
                  <a href="#x1">[Example 1]</a> <a href="#x2">[Example 2]</a> <a href="#x3">[Example 3]</a>
                  <a href="#x4">[Example 4]</a> <a href="#x5">[Example 5]</a><hr/>
The error says the last <hr/> is invalid. What's going on here?

Last edited by yinyang107; 02-13-2011 at 11:00 PM.. Reason: Formatting
yinyang107 is offline   Reply With Quote
Old 02-13-2011, 09:38 PM   PM User | #2
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
Here's the full code:
Code:
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
      <meta name="author" content="Eric Kemp" />
      <title>xHTML Table Examples - INT222 Assignment 1 - Eric Kemp</title>
   </head>

   <body>
      <a id="top"></a>
      <table border="0" width="100%" cellpadding="10">
         <tr>
            <td bgcolor="#FFFFFF" width="200" height="50" align="center" valign="bottom">
               <img src="images/scslogo.png" alt="SCS Logo" title="SCS Logo"/>
            </td>
            <th bgcolor="#FFFFFF" width="*" valign="middle">
               xHTML Table Examples
            </th>
         </tr>

         <tr>
            <td bgcolor="#FFFFFF" align="center" valign="top">
               <br/>-----<br/><a href="index.html"> <img src="images/home.png" alt="Assignment 1 Home Page" title="Assignment 1 Home Page" border="0"/> </a>
               <br/>-----<br/><a href="resume.html"> <img src="images/resume.png" alt="My Resume" title="My Resume" border="0"/> </a>
               <br/>-----<br/><a href="research.html"> <img src="images/research.png" alt="My Research" title="My Research" border="0"/> </a>
               <br/>-----<br/><a href="tables.html"> <img src="images/tables.png" alt="xHTML Table Examples" title="xHTML Table Examples" border="0"/> </a>
               <br/>-----<br/><a href="lists.html"> <img src="images/lists.png" alt="xHTML List Examples" title="xHTML List Examples" border="0"/> </a>
               <br/>-----<br/><a href="contact.html"> <img src="images/contact.png" alt="Contact Me" title="Contact Me" border="0"/> </a>
               <br/>-----<br/><a href="honesty.html"> <img src="images/honesty.png" alt="Honesty Policy" title="Honesty Policy" border="0"/> </a>
               <br/>-----<br/><a href="../index.html"> <img src="images/zenit.png" alt="My Zenit Account" title="My Zenit Account" border="0"/> </a>
               <br/>-----<br/>
            </td>
            <td bgcolor="#CCCCCC" align="center">
               <p>
                  Jump to:<br/>
                  <a href="#x1">[Example 1]</a> <a href="#x2">[Example 2]</a> <a href="#x3">[Example 3]</a>
                  <a href="#x4">[Example 4]</a> <a href="#x5">[Example 5]</a><br/>-----<br/>

                  <a id="x1">Example 1</a><br/>
                  <table width='80%' cellpadding="10" cellspacing="10" align="left" border="10" bgcolor="#FFFFCC">
                     <tr><th>Attribute</th><th>Values</th></tr>
                     <tr><td>Width</td><td><i>Pixels<br/>Percentage</i>%</td></tr>
                     <tr><td>Cellpadding</td><td><i>Pixels</i></td></tr>
                     <tr><td>Cellspacing</td><td><i>Pixels</i></td></tr>
                     <tr><td>Align</td><td>"Left"<br/>"Center"<br/>"Right"</td></tr>
                     <tr><td>Border</td><td><i>Pixels</i></td></tr>
                     <tr><td>BGColor</td><td>RGB(<i>r,g,b</i>)<br/>#<i>rrggbb<br/>colorname</i></td></tr>
                  </table>
                  <a href="#top">[top]</a>
                  <br/><br/>-----<br/>

                  <a id="x2">Example 2</a><br/>
                  <table border="1" bgcolor="#FFFFFF">
                     <tr valign="middle">
                        <th width="100">Time</th>
                        <th width="200">Wednesday</th>
                        <th width="200">Thursday</th>
                        <th width="200">Friday</th>
                     </tr>
                     <tr valign="middle">
                        <td align="center">10:45 - 11:30</td>
                        <td align="center">Censorship</td>
                        <td align="center"> </td>
                        <td align="center">O.O.P.</td>
                     </tr>
                     <tr valign="middle">
                        <td align="center">11:40 - 12:25</td>
                        <td align="center" rowspan="4"> </td>
                        <td align="center" rowspan="2" colspan="2">Business Computing</td>
                     </tr>
                     <tr valign="middle">
                        <td align="center">12:35 - 1:20</td>
                     </tr>
                     <tr valign="middle">
                        <td align="center">1:30 - 2:15</td>
                        <td align="center" rowspan="2">Internet Basics</td>
                        <td align="center" rowspan="2">SQL Databases</td>
                     </tr>
                     <tr>
                        <td align="center">2:25 - 3:10</td>
                     </tr>
                  </table>
                  <a href="#top">[top]</a>
                  <br/>-----<br/>

                  <a id="x3">Example 3</a><br/>
                  <table bgcolor="#FFFFFF">
                     <tr><td align="center">
                        <table bgcolor="#CCCCCC" border="1"><caption align="top">Top NHL Player</caption>
                           <tr><td>Name</td><td>Steven Stamkos</td></tr>
                           <tr><td>Team</td><td>Tampa Bay Lightning</td></tr>
                        </table>
                        <br/>
                        <table bgcolor="#CCCCCC" border="1"><caption align="bottom">Stats</caption>
                           <tr><td>Goals</td><td>40</td></tr>
                           <tr><td>Assists</td><td>34</td></tr>
                           <tr><td>Games Played</td><td>56</td></tr>
                        </table>

                     </td></tr>
                  </table>
                  <a href="#top">[top]</a>
                  <br/>-----<br/>

                  <a id="x4">Example 4</a><br/>
                  <table bgcolor="#FFFFFF">
                     <tr><td align="center">
                        <img src="images/scslogo.png" alt="SCS Logo"/><br/>
                        Eric Kemp<br/>
                        eckemp@learn.senecac.on.ca
                     </td></tr>
                  </table>
                  <a href="#top">[top]</a>
                  <br/>-----<br/>

                  <a id="x5">Example 5</a><br/>
                  <table bgcolor="#FFFFFF" border="1">
                     <tr valign="top" height="50">
                        <td align="left" width="75">INT222</td>
                        <td align="center" width="75">INT222</td>
                        <td align="right" width="75">INT222</td>
                     </tr>
                     <tr valign="middle" height="50">
                        <td align="left" width="75">INT222</td>
                        <td align="center" width="75">INT222</td>
                        <td align="right" width="75">INT222</td>
                     </tr>
                     <tr valign="bottom" height="50">
                        <td align="left" width="75">INT222</td>
                        <td align="center" width="75">INT222</td>
                        <td align="right" width="75">INT222</td>
                     </tr>
                  </table>
                  <a href="#top">[top]</a>
                  <br/>-----<br/>

               </p>
            </td>
         </tr>

         <tr>
            <td></td>
            <td bgcolor="#CCCCCC" align="center">
               <script type='text/javascript'>
               //<![CDATA[

                 document.write ("<a href='http://validator.w3.org/check?uri=" +
                   location.href+ "\;ss=1;verbose=1' target='display'>" +
                   "<img src='https://cs.senecac.on.ca/~int222/images/valid-xhtml10.png' " +
                   "width='60' height='21' border='0' " +
                   "alt='Valid XHTML 1.0 Transitional.' title='Valid XHTML 1.0 Transitional.' /></a>")

                 dt=new Date(document.lastModified);   // Get document last modified date
                 document.write("<small>This page was last modified on "+dt.toLocaleString()+"</small>")

               //]]>
               </script>
            </td>
         </tr>
      </table>
   </body>
</html>

Last edited by yinyang107; 02-13-2011 at 11:08 PM..
yinyang107 is offline   Reply With Quote
Old 02-13-2011, 09:41 PM   PM User | #3
Jimather
New Coder

 
Join Date: Jan 2011
Posts: 66
Thanks: 10
Thanked 5 Times in 5 Posts
Jimather is an unknown quantity at this point
It means exactly that.

You cannot put a horizontal rule inside a table element.

You should not be using tables for your layout anyway. You should be using divs and setting their properties with a style sheet.
Jimather is offline   Reply With Quote
Old 02-13-2011, 09:42 PM   PM User | #4
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
Not allowed, this is a school assignment. I guess I'll replace them with <br/>-----<br/> then.

EDIT: How about "does not allow table", then? The first of these is line 42:
Code:
<table width='80%' cellpadding="10" cellspacing="10" align="left" border="10" bgcolor="#FFFFCC">
EDIT 2: Wait, how come it doesn't protest on my template, and only on the very last hr in my first post?

template.html:
Code:
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
      <meta name="author" content="Eric Kemp" />
      <title>NAME GOES HERE - INT222 Assignment 1 - Eric Kemp</title>
   </head>

   <body>
      <table border="0" width="100%" cellpadding="10">
         <tr>
            <td bgcolor="#FFFFFF" width="200" height="50" align="center" valign="bottom">
               <img src="images/scslogo.png" alt="SCS Logo" title="SCS Logo"/>
            </td>
            <th bgcolor="#FFFFFF" width="*" valign="middle">
               NAME GOES HERE
            </th>
         </tr>

         <tr>
            <td bgcolor="#FFFFFF" align="center" valign="top">
               <hr/><a href="index.html"> <img src="images/home.png" alt="Assignment 1 Home Page" title="Assignment 1 Home Page" border="0"/> </a>
               <hr/><a href="resume.html"> <img src="images/resume.png" alt="My Resume" title="My Resume" border="0"/> </a>
               <hr/><a href="research.html"> <img src="images/research.png" alt="My Research" title="My Research" border="0"/> </a>
               <hr/><a href="tables.html"> <img src="images/tables.png" alt="xHTML Table Examples" title="xHTML Table Examples" border="0"/> </a>
               <hr/><a href="lists.html"> <img src="images/lists.png" alt="xHTML List Examples" title="xHTML List Examples" border="0"/> </a>
               <hr/><a href="contact.html"> <img src="images/contact.png" alt="Contact Me" title="Contact Me" border="0"/> </a>
               <hr/><a href="honesty.html"> <img src="images/honesty.png" alt="Honesty Policy" title="Honesty Policy" border="0"/> </a>
               <hr/><a href="../index.html"> <img src="images/zenit.png" alt="My Zenit Account" title="My Zenit Account" border="0"/> </a>
               <hr/>
            </td>
            <td bgcolor="#CCCCCC" align="center">
               CONTENT GOES HERE
            </td>
         </tr>

         <tr>
            <td></td>
            <td bgcolor="#CCCCCC" align="center">
               <script type='text/javascript'>
               //<![CDATA[

                 document.write ("<a href='http://validator.w3.org/check?uri=" +
                   location.href+ "\;ss=1;verbose=1' target='display'>" +
                   "<img src='https://cs.senecac.on.ca/~int222/images/valid-xhtml10.png' " +
                   "width='60' height='21' border='0' " +
                   "alt='Valid XHTML 1.0 Transitional.' title='Valid XHTML 1.0 Transitional.' /></a>")

                 dt=new Date(document.lastModified);   // Get document last modified date
                 document.write("<small>This page was last modified on "+dt.toLocaleString()+"</small>")

               //]]>
               </script>
            </td>
         </tr>
      </table>
   </body>
</html>

Last edited by yinyang107; 02-13-2011 at 09:58 PM..
yinyang107 is offline   Reply With Quote
Old 02-13-2011, 10:25 PM   PM User | #5
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
Bump, just in case people don't realize this isn't resolved.
yinyang107 is offline   Reply With Quote
Old 02-13-2011, 10:59 PM   PM User | #6
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
Anyone? Why do I get "document type does not allow element "table" here"?
yinyang107 is offline   Reply With Quote
Old 02-13-2011, 11:10 PM   PM User | #7
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
I don’t get an error when I paste your last code into the direct input field of the W3C validator.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 02-13-2011, 11:17 PM   PM User | #8
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
I posted the wrong code in my second post It's fixed now.
yinyang107 is offline   Reply With Quote
Old 02-14-2011, 12:08 AM   PM User | #9
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
Bump again.
yinyang107 is offline   Reply With Quote
Old 02-14-2011, 12:19 AM   PM User | #10
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
You must not put any block level elements (in this case <table>) into a <p> element.

Also, please read the forum guidelines, and don't repeatedly bump your thread.
venegal is offline   Reply With Quote
Old 02-14-2011, 02:26 AM   PM User | #11
yinyang107
New to the CF scene

 
Join Date: Feb 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
yinyang107 is an unknown quantity at this point
Thanks, and sorry. It's due tonight, so I was impatient.
yinyang107 is offline   Reply With Quote
Old 02-14-2011, 02:51 AM   PM User | #12
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
lol maybe you should start school work well before its due? just a thought.
__________________
Teed
teedoff is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:31 AM.


Advertisement
Log in to turn off these ads.