Web Analytics Made Easy -
StatCounter Need help with a table question - CodingForum

Announcement

Collapse
No announcement yet.

Need help with a table question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with a table question

    Hi, I am still validating my pages and this one has me stumped. I know it is something simple but I'm not finding it. When I try to validate I get this error:

    document type does not allow element "DIV" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag
    <div align="center">Dates

    This is the table as it is on the page anf yhr only thing ahead of it is the <h1>

    <table width="95%" border="1" cellspacing="0" cellpadding="4">
    <tr>
    <!-- Row 1 Column 1 -->
    <td bgcolor="#CC6666">
    <b>
    <div align="center">Dates
    </div> </b>
    </td>
    <!-- Row 1 Column 2 -->
    <td bgcolor="#CC6666">
    <b>
    <div align="center">Weekly</div>
    </b>
    </td>
    <!-- Row 1 Column 3 -->
    <td bgcolor="#CC6666">
    <b>
    <div align="center">Rate</div>
    </b>
    </td>
    <!-- Row 1 Column 4 -->
    <td bgcolor="#CC6666">
    <b>
    <div align="center"> Availability
    </div> </b>
    </td>
    </tr>

    <tr>
    <!-- Row 3 Column 1 -->
    <td>
    <div align="center">02/28 - 03/06</div>
    </td>
    <!-- Row 3 Column 2 -->
    <td>
    <div align="center">Saturday - Saturday</div> </td>
    <!-- Row 3 Column 3 -->
    <td>
    <div align="center">000.00 </div>
    </td>
    <!-- Row 3 Column 4 -->
    <td>
    <div align="center">Open</div>
    </td>
    </tr>

  • #2
    You have <b><div ...></div></b>. <b> is an inline tag, which can never contain block-level tags like <div>. Simply swap the order of those two tags around to solve the problem:
    Code:
     <b><div align="center">Dates</div> </b>
    
    becomes
    
    <div align="center"><b>Dates</b></div>
    On another matter, you probably shouldn't be using <b> at all. This is because it's a presentational tag. If a program came along that converts a page into braille or speaks it out loud, what would it do with <b>? It looks like you're trying to make headers with <b>. Instead, try using one of the header tags <h1><h2><h3> ... <h6>. That would be a better solution.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

    Comment

    Working...
    X