Validating XHTML

Watch Me Sink

Madly Diligent
Joined
Dec 31, 2007
Messages
6,381
Reaction score
1
FP$
83
I'm having some trouble validating my website. I've been fixing many errors (mainly just deprecated tags), but recently ran into a problem.
I have the following code within a file:
Code:
   echo '

<div id="side_borders_inner">

<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center">

   <tr>

      <td width="100%" class="logo_bg"> 

         <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
            <a href="http://disturbedmb.com">
            

               <img src="', $settings['images_url'], '/header.jpg" border="0" alt="Disturbed" />
               

            
            </a></tr>

            <tr>

               <td height="31" colspan="2" class="meny_bg" style="background-image: url(', $settings['images_url'], '/sub.gif)">

                  <table cellpadding="6" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">

                     <tr align="center">

                        ', template_menu(), '

                     </tr>

                  </table>

               </td>

            </tr>

            <tr>

               <td height="17" colspan="2" class="meny_bg_bottom" style="background-image: url(', $settings['images_url'], '/menu_bottom_bg.gif)"> </td>

            </tr>

         </table>

      </td>

   </tr>   

</table>
(yes, the div gets closed at the end). The only problem is that <a> isn't allowed within <tr>. Does anybody see a fix for this?
 
You should never put anything inside a <tr> itself, it's not designed for holding data. It might work, but it's very bad practice.

Use a <td> inside the <tr> to show the link, for example:
Code:
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>
                <a href="http://disturbedmb.com">
               

                   <img src="', $settings['images_url'], '/header.jpg" border="0" alt="Disturbed" />
                   

               
                </a></td></tr>

<tr> just creates the row, <td> displays the column(s).
 
Back
Top Bottom