【问题标题】:Thymeleaf, dont insert linebreaks in numbersThymeleaf,不要在数字中插入换行符
【发布时间】:2018-11-19 12:30:53
【问题描述】:

我在百里香中有以下一行

<td th:text="${#numbers.formatDecimal(p.position, 0, 'WHITESPACE', 4, 'POINT')}">POSITION</td>

因此,为了便于阅读,使用空格作为 looong 数字的分隔符。 这可以正常工作,但现在我在表格中的数字中间有换行符,比以前更难阅读。 像这样:

160
120.3292

有没有办法使用“&amp;nbsp;”类型的字符之类的?

【问题讨论】:

    标签: java thymeleaf whitespace


    【解决方案1】:

    使用 css 来防止换行。 (white-space: nowrap 应该可以解决这个问题。)

    <td th:text="${#numbers.formatDecimal(p.position, 0, 'WHITESPACE', 4, 'POINT')}" style="white-space: nowrap;">POSITION</td>
    

    【讨论】:

      猜你喜欢
      • 2022-01-15
      • 2017-11-14
      • 2013-05-23
      • 1970-01-01
      • 1970-01-01
      • 2011-01-22
      • 2014-03-11
      • 2016-08-05
      • 2011-05-04
      相关资源
      最近更新 更多