对调查结果进行统计的页面,在div的style中拼接后台参数,显示百分比
<tr th:each="option:*{obj.list}">
<td th:text="*{option.title}">选项</td>
<td th:text="*{option.poll}">小计</td>
<td th:inline="text">
<div style="float:left;width:160px; height:15px;
margin:3px 10px 0 10px;border-style:solid;border-width:1px;">
<div th:style="'background:#5f8dd4;height:15px;width:'+*{option.rate}+''">
</div>
</div>
<span>[[*{option.rate}]]</span>
</td>
</tr>
显示效果