Jump to content

html table does not validate.


sepoto

Recommended Posts

This is the table:

		<table width="980" border="0" cellspacing="0" cellpadding="0">					<tr><div id="menu">					<td  colspan="9"align="left" width="980"><img src="images/header5.jpg" alt="" width="980" height="100" align="top" border="0" alt="The Law Office of Dinah Perez specializes in entertainment legal services for the motion picture, television, music, theatre, publishing and new media industries. Services for filmmakers , musicians, actors, photographers, production designers, talent agencies,"/></td>							</tr>						<tr height="25" align="left">				<td bgcolor="#333333" width="70" height="25" >					<div align="center">						<a onmouseover="changeImages('home','images/home2.jpg');return true" onmouseout="changeImages('home','images/home2.jpg');return true"><font color="#333333"><img id="home" src="images/home2.jpg" alt="" name="home" width="48" height="25" align="middle" border="0" /></font></a></div>				</td>				<td bgcolor="#333333" width="76" height="25">					<div align="center">						<a onmouseover="changeImages('about','images/about2.jpg');return true" onmouseout="changeImages('about','images/about.jpg');return true" href="about.html"><font color="#333333"><img id="about" src="images/about.jpg" alt="" name="about" width="54" height="25" border="0" /></font></a></div>				</td>				<td bgcolor="#333333" width="90" height="25">					<div align="center">						<a onmouseover="changeImages('services','images/services2.jpg');return true" onmouseout="changeImages('services','images/services.jpg');return true" href="services.html"><font color="#333333"><img id="services" src="images/services.jpg" alt="" name="services" width="69" height="25" border="0" /></font></a></div>				</td>				<td bgcolor="#333333" width="128" height="25">					<div align="center">						<a onmouseover="changeImages('legalArticles','images/legalArticles2.jpg');return true" onmouseout="changeImages('legalArticles','images/legalArticles.jpg');return true" href="legalArticles.html"><font color="#333333"><img id="legalArticles" src="images/legalArticles.jpg" alt="" name="legalArticles" width="108" height="25" border="0" /></font></a></div>				</td>				<td bgcolor="#333333" width="118" height="25" >					<div align="center">							<a onmouseover="changeImages('terminology','images/terminology2.jpg');return true" onmouseout="changeImages('terminology','images/terminology.jpg');return true"><font color="#333333"><img id="terminology" src="images/terminology.jpg" alt="" name="terminology" width="97" height="25" border="0" class="menuanchorclass" rel="anylinkmenu2"/></font></div>				</td>				<td bgcolor="#333333" width="90" height="25">					<div align="center">						<a onmouseover="changeImages('books','images/books2.jpg');return true" onmouseout="changeImages('books','images/books.jpg');return true" href="books.html"><img id="books" src="images/books.jpg" alt="" name="books" width="54" height="25" border="0" /></a></div>				</td>				<td bgcolor="#333333" width="108" height="25">					<div align="center">						<a onmouseover="changeImages('resources','images/resources2.jpg');return true" onmouseout="changeImages('resources','images/resources.jpg');return true" href="resources.html"><img id="resources" src="images/resources.jpg" alt="" name="resources" width="85" height="25" border="0" /></a></div>				</td>				<td bgcolor="#333333" width="100" height="25">					<div align="center">						<a onmouseover="changeImages('contact','images/contact2.jpg');return true" onmouseout="changeImages('contact','images/contact.jpg');return true" href="contact.html"><img id="contact" src="images/contact.jpg" alt="" name="contact" width="67" height="25" border="0" /></a></div>				</td>				<td bgcolor="#333333" width="100" height="25"> 					<div align="center">						<a onmouseover="changeImages('espanol','images/espanol2.jpg');return true" onmouseout="changeImages('espanol','images/espanol.jpg');return true"><img id="espanol" src="images/espanol.jpg" alt="" name="espanol" width="85" height="25" border="0" class="menuanchorclass" rel="anylinkmenu1"/></a></div>				</td>				</div></tr>

This is the validation error:

Line 130, Column 15: document type does not allow element "div" here; missing one of "th", "td" start-tag<div id="menu">✉The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

Is there an easy fix? I see there is some talk about a containing element. I am trying to avoid ripping everything apart if I don't have to.

Link to comment
Share on other sites

A few elements can only contain certain kinds of child elements. Tables and table rows are like this. The only DIRECT child of a <tr> can be a <td>. Your code attempts to put a <div> directly inside a <tr>. This cannot be. A <div> can go inside a <td> or it can enclose the whole <table> or it can be completely outside the <table>. Those are your choices.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...