Jump to content


Validation Error


4 replies to this topic

#1 R-B

    Young Padawan

  • Members
  • Pip
  • 20 posts

Posted 09 June 2007 - 10:40 PM

My knowledge of coding is not that great but earlier today while attempting to validate a site I've been working on I got the following errors below.

The tag: "table" doesn't have an attribute: "height" in currently active versions.[HTML 4.0]
The tag: "td" doesn't have an attribute: "background" in currently active versions.[HTML 4.0]
The tag: "td" doesn't have an attribute: "background" in currently active versions.[HTML 4.0]
The tag: "td" doesn't have an attribute: "background" in currently active versions.[HTML 4.0]

I've tried to make sense of them but given my newbish coding knowledge I thought I should ask. Maybe someone will tell me something about this I hadn't known. Below is the entire HTML code. How do I go about solving this problem so the page will validate without any errors?




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>One Designer | Online Journal & Portfolio </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-color: #444842;
	background-image: url(images/bkg.gif);
	background-repeat: repeat-x;
}
-->
</style></head>
<body>
<table width="742" height="589" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
	<tr>
		<td colspan="2">
			<img src="images/Logo.gif" width="140" height="169" alt=""></td>
		<td colspan="4">
			<img src="images/Top_Banner.gif" width="602" height="169" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/Featured_Empty_Space.gif" width="742" height="1" alt=""></td>
	</tr>
	<tr>
		<td colspan="3">
			<img src="images/Featured_project.gif" width="370" height="192" alt=""></td>
		<td colspan="3">
			<img src="images/Featured_Empty_Space-06.gif" width="372" height="192" alt=""></td>
	</tr>
	<tr>
		<td colspan="4">
			<img src="images/Empty_Navigation_Space.gif" width="371" height="40" alt=""></td>
		<td colspan="2">
			<img src="images/Navigation.gif" width="371" height="40" alt=""></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_08.gif" width="742" height="4" alt=""></td>
	</tr>
	<tr>
		<td background="images/locbg.gif"></td>
		<td colspan="4" background="images/conbg.gif"><?PHP
 include("entry/show_news.php");
?></td>
		<td background="images/featbg.gif"></td>
	</tr>
	<tr>
		<td colspan="6">
			<img src="images/index_12.gif" width="742" height="24" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/spacer.gif" width="25" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="115" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="230" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="112" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="259" height="1" alt=""></td>
	</tr>
</table>
</body>
</html>


#2 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 09 June 2007 - 11:15 PM

1) remove 'height="589"', tables shouldn't be fixed vertically.

2) replace '' with a CSS class containing the background url. Using background property directly on a cell is invalid.

#3 R-B

    Young Padawan

  • Members
  • Pip
  • 20 posts

Posted 10 June 2007 - 01:05 AM

I did the first one and the number of errors dropped to 3. But can't figure out how to accomplish the third one. If it's not asking too much how exactly do I go about accomplishing that?



P.S. I know such newbish questions can sound stupid and can be annoying, but I'm only trying to learn and won't be able to learn if I don't ask. Thanks for your understanding

#4 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 10 June 2007 - 03:06 AM

Basically like this

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>One Designer | Online Journal & Portfolio </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-color: #444842;
    background-image: url(images/bkg.gif);
    background-repeat: repeat-x;
}
td.cell_1{
background-image:url(images/locbg.gif);
}
td.cell_2{
background-image:url(images/conbg.gif);
}
td.cell_3{
background-image:url(images/featbg.gif);
}
-->
</style></head>
<body>
<table width="742" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
    <tr>
        <td colspan="2">
            <img src="images/Logo.gif" width="140" height="169" alt=""></td>
        <td colspan="4">
            <img src="images/Top_Banner.gif" width="602" height="169" alt=""></td>
    </tr>
    <tr>
        <td colspan="6">
            <img src="images/Featured_Empty_Space.gif" width="742" height="1" alt=""></td>
    </tr>
    <tr>
        <td colspan="3">
            <img src="images/Featured_project.gif" width="370" height="192" alt=""></td>
        <td colspan="3">
            <img src="images/Featured_Empty_Space-06.gif" width="372" height="192" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Empty_Navigation_Space.gif" width="371" height="40" alt=""></td>
        <td colspan="2">
            <img src="images/Navigation.gif" width="371" height="40" alt=""></td>
    </tr>
    <tr>
        <td colspan="6">
            <img src="images/index_08.gif" width="742" height="4" alt=""></td>
    </tr>
    <tr>
        <td class="cell_1"></td>
        <td class="cell_2" colspan="4"><?PHP
include("entry/show_news.php");
?></td>
        <td class="cell_3"></td>
    </tr>
    <tr>
        <td colspan="6">
            <img src="images/index_12.gif" width="742" height="24" alt=""></td>
    </tr>
    <tr>
        <td>
            <img src="images/spacer.gif" width="25" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="115" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="230" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="112" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="259" height="1" alt=""></td>
    </tr>
</table>
</body>
</html>

Or if you want to do it the lazy way, just replace background="images/featbg.gif" with style="background-image:url(images/featbg.gif);" within the table cell itself.

#5 R-B

    Young Padawan

  • Members
  • Pip
  • 20 posts

Posted 10 June 2007 - 03:09 AM

Thank you very much AV- it's all clean now.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users