Jump to content

Table Cells PHP Color Possiblity


gazalec

Recommended Posts

Hi guys trying the impossible again, ok well i was wondering if this would be possible, ok so i have an order_date and no_of_products variable pulled from a database $a $b (lets say they are 2007-03-01 and 200) respectivley, i was wondering if it would be possible to write an HTML table through PHP like this

 

<?

echo "<table>
         <tr>
         <td> ETC.

 

but i was wondering if it was possible to have each cell given an id to equal one date plus a quantity for instance

 

<td id='2007-03-01-100'>

 

but i was wondering if there was anyway to have the color attribute have an if condition i.e.

 


$func = if('id' = $a."-".$b){
echo "000000";
}else{
echo "FFFFFF";
}
echo "<td id='2007-03-01-200' color='".func."'>

 

The idea is if a number of products is bought on a date if this is parallel to the table the cell is turned black

 

Thanks For any help on this one guys...and girls.

Link to comment
https://forums.phpfreaks.com/topic/45753-table-cells-php-color-possiblity/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.