|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
control table cells
I need to be able to change the colour content of table cells (red, amber, green) depending on a row value in a mysql table.
Does anyone out there know a) if this can be done and b) how it can be done? As i am hosted, im not sure which php version i have. |
|
#2
|
||||
|
||||
|
RE: control table cells
You can set the background color of a table cell as follows:
Code:
<td style="background-color: #00FF00;"> ... </td> Just replace the "#00FF00" with whatever color you want - or use php to calculate the color depending on whatever data you want. Alternatively, you could define CSS classes for each color you want and then use class="class_name" instead of style="...". |
|
#3
|
|||
|
|||
|
RE: control table cells
If you want to find out information about PHP on your server, make a page with this in it:
You will see a page with tons of info on your version of PHP |
|
#4
|
|||
|
|||
|
RE: control table cells
Supposing your color from mysql table is stored in $val
if($val=="red") $color="#ff0000"; if($val=="green") $color="#00ff00" ||ly for amber Then inside your table <td bgcolor="<? echo $color; ?>"> |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > control table cells |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|