have a border for blank cells

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
podarum
Forum Commoner
Posts: 51
Joined: Mon Jun 15, 2009 1:36 pm

have a border for blank cells

Post 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>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: have a border for blank cells

Post by requinix »

Put an &nbsp; in the empty cells.
podarum
Forum Commoner
Posts: 51
Joined: Mon Jun 15, 2009 1:36 pm

Re: have a border for blank cells

Post 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..
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: have a border for blank cells

Post 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.
Post Reply