SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old July 2nd, 2003, 02:44 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #2  
Old July 2nd, 2003, 03:08 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
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="...".

Reply With Quote
  #3  
Old July 9th, 2003, 07:10 AM
stormskater86 stormskater86 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 15 stormskater86 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: control table cells

If you want to find out information about PHP on your server, make a page with this in it:
php Code:
Original - php Code
  1. <?php
  2. ?>

You will see a page with tons of info on your version of PHP

Reply With Quote
  #4  
Old July 9th, 2003, 07:37 AM
mathewvp mathewvp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 143 mathewvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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; ?>">

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > control table cells


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway