corbeeresearch Posted September 26, 2010 Share Posted September 26, 2010 Hi, I'm trying to make a poll and while the poll is working, I used the table to control the length of the bar, unfortunately once the graphic bar gets too long, it lost alignment with the table. Where did I get wrong? Or are there better solution than this? echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' >"; $i = 0; while($noticia = mysql_fetch_array($rs)){ echo "<tr> <td width='5%' bgcolor='#F1F1F1'> <font size='1' face='Verdana' color='#000000'>$noticia[opt]</font></td>"; $width2=$noticia['no'] *10 ; /// change here the multiplicaiton factor ////////// $ct=($noticia[no]/$rt)*100; $ct=sprintf ("%01.2f", $ct); // number formating echo " <td width='20%' bgcolor='#F1F1F1'> <font size='1' face='Verdana' color='#000000'>($ct %)</font></td><td width='60%' align='left' bgcolor='#F1F1F1'> <img src='graph.jpg' height=10 width=$width2>"; echo "</td><td width='15%' align='right'>"; echo "<font size='1' face='Verdana' color='#000000'>".$total_opt[$i]; echo " votes"; echo "</font></td>"; echo "</tr>"; echo "<tr> <td bgcolor='#ffffff' colspan=2>"; echo "</td>"; echo "</tr>"; $i=$i+1; } echo "<tr><td></td><td></td><td><font size='1' face='Verdana' color='#000000'>Total Votes:</font></td><td align='right'>"; //count the total votes $count = 'select count(ans_id) from plus_poll_ans'; $count = mysql_query($count); $count = mysql_fetch_array($count); $total_count = $count['count(ans_id)']; echo "<font size='1' face='Verdana' color='#000000'>".$total_count." votes</font>"; echo "</td></tr>"; echo "</table>"; echo "</font>"; Thanks Link to comment https://forums.phpfreaks.com/topic/214412-graphic-bar-display-problem-on-table/ Share on other sites More sharing options...
Miss_Rebelx Posted September 27, 2010 Share Posted September 27, 2010 Can you post a screenshot of what it does exactly? Link to comment https://forums.phpfreaks.com/topic/214412-graphic-bar-display-problem-on-table/#findComment-1116320 Share on other sites More sharing options...
corbeeresearch Posted September 30, 2010 Author Share Posted September 30, 2010 I think I did something, it is now not causing indention, but the graph is still not displaying correctly [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/214412-graphic-bar-display-problem-on-table/#findComment-1117544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.