d22552000 Posted September 1, 2007 Share Posted September 1, 2007 What is the easiest way to show a table with two fields, the first ebing the percentage of progress adnt eh second being there to show blank. I thought I could do: <table bgcolor="black" width="50%" id="prg"> <tr> <td bgcolor="green" width="prgprct"></td> <td>&</td> </tr> I know that bgcolor isnt the right command and my ID is wrong but you get the point. I have AJAX feeding the script the value but is there an easier way of showing the graph? Quote Link to comment https://forums.phpfreaks.com/topic/67573-percentage-graph/ Share on other sites More sharing options...
Barand Posted September 1, 2007 Share Posted September 1, 2007 Personally, I'd use a GD image but <?php $a = 100; $b=40; $c = 80; echo <<<HTML <table width='50%' bgcolor='black'> <tr> <td bgcolor='red' width='$a%'>$a</td> <td></td> </tr> </table> <table width='50%' bgcolor='black'> <tr> <td bgcolor='yellow' width='$b%'>$b</td> <td></td> </tr> </table> <table width='50%' bgcolor='black'> <tr> <td bgcolor='orange' width='$c%'>$c</td> <td></td> </tr> </table> HTML; ?> Math content minimal, this is HTML, so moving it. Quote Link to comment https://forums.phpfreaks.com/topic/67573-percentage-graph/#findComment-339474 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 wouldnt a gd image be problematic or slow loading if it was refreshing second wise? also my apache doenst seem to like gd2 module. when I enable it vbulletin still cant output gd2 images, so I had to use imagmagic and I dont even know how to work it -,-. Quote Link to comment https://forums.phpfreaks.com/topic/67573-percentage-graph/#findComment-340461 Share on other sites More sharing options...
Azu Posted September 3, 2007 Share Posted September 3, 2007 The GD library is not needed to make a graph.. Look at all of these graphs made in pure CSS! http://images.google.com/images?q=CSS+graphs&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficial&um=1&sa=N&tab=wi Quote Link to comment https://forums.phpfreaks.com/topic/67573-percentage-graph/#findComment-340805 Share on other sites More sharing options...
sneamia Posted September 6, 2007 Share Posted September 6, 2007 I believe your original post is simplest, modifying the width of a cell in a table. Quote Link to comment https://forums.phpfreaks.com/topic/67573-percentage-graph/#findComment-342599 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.