For reference, the page being referred to is located here: http://talentforceinc.com/Employers_Home.html.
The specific code referred to is here: http://www.i-simplyrecruit.com/isrjobs/talentforce/ShowJobColors.asp and also shown below for reference.
The first problem is (as you mentioned), the code is ugly. So ugly in fact that it is very hard to see that:
- There are unfinished HTML space entities ( ) in the "Cementing Service..." and "Document Layout Specialist" cells. This is causing portions of the ending tags that follow to be ignored.
- HTML attributes for width and height are integer values only. Do not specify "px". ex. 450 instead of 450px.
- The closing <div> tag in each cell (with a class of "sidebar") is placed after the ending <td> and <tr>.
After fixing these errors, I also notice that you have a table width set at 185 and each table cell width is set at 100. This is keeping the table cells from taking up the entire width of the table, making the text within them not able to be centered within the width of the table. Removing the cell width fixes this problem.
I have uploaded a test page with the original unmodified code and the results of my changes: http://demo.raleighbuckner.com/so/1303302/
Original HTML for reference:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://demo.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Latest Jobs</title>
<link href="http://www.talentforceinc.com/talentforce.css" rel="stylesheet" type="text/css" />
<!--[if LTE IE 7]>
<link href="http://www.talentforceinc.com/talentforce_IE.css" rel="stylesheet" type="text/css" />
<![endif]-->
<style type="text/css">
<!--
td {
text-align: center;
align: center;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function ShowMore(pID)
{
var pParm = "Candidates_jobSearch3.asp?id=" + pID;
MM_openBrWindow(pParm,"jobDetail","scrollbars=yes,width=600,height=600 resizable=no");
}
//-->
</script>
</head>
<body>
<table width=185px bgcolor=white border=0 cellpadding=0 cellspacing=0 style='text-align:center'><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#00AADD'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("P0006008-0032");'>Contractor Engineer Specialist</a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#AADDEE'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("N0003008-0077");'>.Net & Sql server An</a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#FFCC55'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("S5696007-0004");'>Cementing Service Sup/Deep&nbs</a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#22AA55'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("S4082007-0012");'>Coil Tubing Operator/Equipment</a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#9999AA'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("L0008004-0157");'>Loads Analysis </a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#EE9922'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("D6452009-0448");'>Document Layout Specialist&nbs</a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#CCCCCC'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("L0008004-0161");'>Technical Trainer </a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#00AAAA'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("A0029005-0025");'>Q.A. Engineer </a></div></td></tr></div><tr><td height=40 width=100px align=center style='text-align:center' valign=middle bgcolor='#888888'><div class='sidebar'><div align='center'><a style='text-align:center' href='#' onclick='javascript:ShowMore("E0001008-0090");'>Clerk Secret Clearance</a></div></td></tr></div></table>
</body>
</html>