Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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-14-2011 at 12:00 AM. Reason: Formatting

  • #2
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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-14-2011 at 12:08 AM.

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    66
    Thanks
    10
    Thanked 5 Times in 5 Posts
    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.

  • #4
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 10:58 PM.

  • #5
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Bump, just in case people don't realize this isn't resolved.

  • #6
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone? Why do I get "document type does not allow element "table" here"?

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,918
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    I don’t get an error when I paste your last code into the direct input field of the W3C validator.

  • #8
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I posted the wrong code in my second post It's fixed now.

  • #9
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Bump again.

  • #10
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    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.

  • #11
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, and sorry. It's due tonight, so I was impatient.

  • #12
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    lol maybe you should start school work well before its due? just a thought.
    Teed


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •