【发布时间】:2022-09-30 18:05:27
【问题描述】:
我正在准备一个网页,我需要为其生成一个评级项目列表,例如 item rating
使用以下代码生成
<ul class=\"dotleaders\">
<li>
<span>numpy</span>
<span>
<i class=\"fa fa-circle\" style=color:orange></i>
<i class=\"fa fa-circle\" style=color:orange></i>
<i class=\"fa fa-circle-o\" style=color:orange></i>
</span>
</li>
</ul>
我有很多这样的评级要插入,而不是重写上面的代码 50 次,我想要一个合适的 html,或者任何可行的函数,它将 item:text rate:integer 作为变量并生成适当的 html代码。如果函数可以直接从文本文件中读取变量,那就更好了。
有什么建议吗? 此致