加了thymeleaf的th:标签后div无法显示在同一行
想用th:switch来显示指定html内容。有没有什么其他方法可以做到这种效果。th:标签写在div里,div会自动换行。用了display:inline-block等方法也不行。原因应该就是多了一层div。
具体问题:
使用th:each后每个col都独占一行,不能一行多个显示
<div class="row filterable-content">
<div th:each="item, itemStat: ${xxxx_list}" th:switch="${item.xxxx_area}">
<!-- col start -->
<div th:case="1" class="col-sm-6 col-xl-3 filter-item 1">
xxx
</div>
<!-- end col -->
</div>
</div>
原来这样是正常显示的:
<div class="row filterable-content">
<!-- col start -->
<div class="col-sm-6 col-xl-3 filter-item 1">
xxx
</div>
<!-- end col -->
</div>
其他:用了bootstrap的框架。是一个springboot项目。