Reputation: 11
I'm trying to create a progress bar in a HTML table cell which gets it's data from Mysql, so that I can display how much my garbage bin is filled. So far,with the help of stackoverflow I've been able to construct this :
echo "<tr><td>".$row["Time"]."</td><td>".$row["nodeID"]."</td>
<td>".$row["Location"]."</td><td><div class='bg' style='width: 20%'>
</div>".$row["Percent_Filled"]."</td></tr>";
This works, but I need the progress bar width to take value from $row["Percent_Filled"]. I'm not able to do this without some or the other syntax error.
Upvotes: 0
Views: 601
Reputation:
You are almost there, just replace style='width: 20%'
with style='width:". $row['Percent_Filled']."%'
Upvotes: 1