简体   繁体   English

在HTML表格单元格内创建进度条

[英]Creating a Progress bar inside a HTML table cell

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. 我正在尝试在HTML表格单元中创建一个进度条,该进度条从Mysql获取数据,以便可以显示我的垃圾箱已满。 So far,with the help of stackoverflow I've been able to construct this : 到目前为止,借助stackoverflow,我已经能够构造以下代码:

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"]. 这可行,但是我需要进度条的宽度才能从$ row [“ Percent_Filled”]中获取值。 I'm not able to do this without some or the other syntax error. 没有某些或其他语法错误,我将无法执行此操作。

您快到了,只需将style='width: 20%'替换为style='width:". $row['Percent_Filled']."%'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM