Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html thymeleaf:同一TD中的文本和图标_Html_Css_Thymeleaf_Font Awesome - Fatal编程技术网

Html thymeleaf:同一TD中的文本和图标

Html thymeleaf:同一TD中的文本和图标,html,css,thymeleaf,font-awesome,Html,Css,Thymeleaf,Font Awesome,我想把文本和图标放在表格的同一个单元格中,就像这样,但它似乎不起作用,因为只有文本出现 <td class="col_name" th:text="${mareSuperiora.linkQuality}" >GOOD <span th:if="${mareSuperiora.linkQuality == 'EXCELLENT'}" > <i cla

我想把文本和图标放在表格的同一个单元格中,就像这样,但它似乎不起作用,因为只有文本出现

<td class="col_name" th:text="${mareSuperiora.linkQuality}" >GOOD
  <span th:if="${mareSuperiora.linkQuality == 'EXCELLENT'}" >                                                     
    <i class="fa fa-signal fa-2x" style="color:#009933; text-align: center;" aria-hidden="true"></i>                                           
  </span>
  <span th:if="${mareSuperiora.linkQuality == 'GOOD'}" >                                                     
    <i class="fa fa-signal fa-2x" style="color:#0066cc; text-align: center;" aria-hidden="true"></i>                                           
  </span>
  <span th:if="${mareSuperiora.linkQuality == 'AVERAGE'}" >                                                     
    <i class="fa fa-signal fa-2x" style="color:#ff9900; text-align: center;" aria-hidden="true"></i>                                           
  </span>
  <span th:if="${mareSuperiora.linkQuality == 'LIMIT'}" >                                                     
    <i class="fa fa-signal fa-2x" style="color:#ff5050; text-align: center;" aria-hidden="true"></i>                                           
  </span>
</td><!-- NAME -->
很好

th:text将替换所有子节点,在这种情况下,也将替换图标的标记。解决方案是为文本部分添加专用的
span


好的

th:text将替换所有子节点,在这种情况下,也将替换图标的标记。解决方案是为文本部分添加专用的
span


好的

你确定要包括字体库吗?是的,我正在模板的另一部分使用它。你确定要包括字体库吗?是的,我正在模板的另一部分使用它