inserting an if statement in a table

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

inserting an if statement in a table

Post by podarum »

HI, I'm trying to embed an if statement into an HTML table.. I've created the table and now I want to specify if (.$Months<6) then put an X in column1 and row1, if it's (.$Months<12) then put the X in column2 row1... here's my code.

Code: Select all

 
<?php
<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%'>Positive<TH width ='5%'>Neutral
 
<TR><TH align=left>The age of your file<TD align=center>if (.$Months<6)
{echo "X";}<TD align=center>if(.$Months<12){echo "X";}
?>
 
It's the code (eg. if(.$Months<6) {echo "X";} and the 12) that I think is giving me the error... anyone know how I can get this resolved.. Thanks
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: inserting an if statement in a table

Post by Mark Baker »

Code: Select all

 
<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%'>Positive<TH width ='5%'>Neutral
 
<TR><TH align=left>The age of your file<TD align=center><?php if ($Months<6)
{echo "X";} ?><TD align=center><?php if ($Months<12){echo "X";} ?>
 
Post Reply