Click to See Complete Forum and Search --> : Why are parts of my <table> disappearing?


decibel
07-13-2005, 04:16 PM
Hi. I am creating a table using the code below: (Its in a php document). My table has a background-color of black, with <td>'s being white, so i have borders around the table and between rows and columns. 9 columns, each row using colspan to make up the 9 columns, however this is causing some of the borders to not show the background color. I have done this before in different documents, so im wondering why it is doing this now. Is this a common HTML problem?

$text .= "
<table style='width:760px;background-color:#000000'>
<tr>
<td colspan='2' style='background-color:#ffffff'>&nbsp;<font size='1'>Patient Last Name</font><br />
&nbsp;".$lname."
</td>
<td colspan='2' style='background-color:#ffffff'>&nbsp;<font size='1'>First Name</font><br />
&nbsp;".$fname."
</td>
<td style='background-color:#ffffff'>";
if($patsex == 'M'){
$text .= "<input type='checkbox' name='sex' value='M' checked>Male<br />
<input type='checkbox' name='sex' value='F'>Female";
}elseif($patsex == 'F'){
$text .= "<input type='checkbox' name='sex' value='M'>Male<br />
<input type='checkbox' name='sex' value='F' checked>Female";
}else{
$text .= "<input type='checkbox' name='sex' value='M'>Male<br />
<input type='checkbox' name='sex' value='F'>Female";
}
$text .= "
</td>
<td colspan='3' style='background-color:#ffffff'>&nbsp;<font size='1'>D.O.B.</font><br />
&nbsp;".$dob."
</td>
<td style='background-color:#ffffff'><font size='1'>&nbsp;Age</font><br />
&nbsp;".$age."
</td>
</tr>
<tr>
<td colspan='3' style='background-color:#ffffff'>&nbsp;<font size='1'>Address</font><br />
&nbsp;".$patadd."
</td>
<td colspan='3' style='background-color:#ffffff'>&nbsp;<font size='1'>Phone</font><br />
&nbsp;".$patphone."
</td>
<td colspan='3' style='background-color:#ffffff'>&nbsp;<font size='1'>Id number</font><br />
&nbsp;".$idnumber."
</td>
</tr>";

Mongus
07-13-2005, 07:01 PM
Can you post the resulting HTML? That would make it much easier to find the problem.

ray326
07-13-2005, 08:55 PM
Pull the font and background defs out and put them in a style sheet. Do a border-collapse:collapse on the table then set borders for the cells in the style sheet.

decibel
07-13-2005, 09:03 PM
I realize i should have given a visual display orginally, but the site is private, and i didn't realize (forgot) that i could add a jpeg attachment. So heres a jpeg of the problem. you'll see on the right side of the table, the table disappears for some reasonn.

decibel
07-13-2005, 09:14 PM
Ray, that does sound like a better solutions. as far as using the CSS, i know i need to , i just got lazy. The border-collapse:collapse attribute is one that i have not used yet, so i will look into and see if it works, thanks.