Page 1 of 1

have a border for blank cells

Posted: Fri Sep 25, 2009 10:32 pm
by podarum
Hi, I have a table created in php that has an embedded if statement.. I need to make any blank cells in the table to have a border just as the populated cells ..take a look, and you'll see what I mean.. Thanks

Code: Select all

<?php
print"
<tr><th colspan=5 align=center> <font size=5 color=maroon>SCORECARD</th></tr></font>
<TR><TH width='50%'rowspan='2'><TH colspan='3'>Effect on Your Credit File
    <TH rowspan='2' width ='5%'> Affecting Your Credit Score
<TR><TH width ='5%'>Negative<TH width ='5%'>Neutral<TH width ='5%'>Positive</th></tr>";?>
 
<TR><TH align=left>The age of your file<TD align=center><?php if($Months<=6) {echo "X";} elseif($Months<=12) {echo "";} else {echo "";}?><TD align=center><?php if($Months<=6) {echo "";} elseif($Months<=12){echo"X";} else {echo"";}?><TD align=center><?php if($Months<=6) {echo "";} elseif($Months<=12){echo"";} else {echo"X";}?><TD align=center>

Re: have a border for blank cells

Posted: Fri Sep 25, 2009 10:43 pm
by requinix
Put an &nbsp; in the empty cells.

Re: have a border for blank cells

Posted: Fri Sep 25, 2009 11:49 pm
by podarum
See I tried that and becasue it's dynamic with the if statemtn (depending on the user's input), the empty cells could change. like it might be empty or it might not.. and I think the nbsp works only if you know which cells are empty..

Re: have a border for blank cells

Posted: Sat Sep 26, 2009 12:01 am
by requinix
Yeah...

Somehow you're printing the table. Somehow you're putting something in the cells. Somehow you know what to put in.
Somehow you should know whether the cell is empty or not.