首页 > 解决方案 > 单元格文本未换行(html 表格)

问题描述

首先,我将向您展示它在 atm 中的显示方式:

图片

如您所见,单元格最大宽度正在工作,但文本没有换行,而是溢出单元格。

这是我设置在表格中的 css:

border-spacing: 0 5px;
table-layout: fixed;
word-wrap:break-word;

这是我为该特定单元格设置的 css:

text-align: center;
font-weight: bold;
max-width: 100px;

标签: htmlcssthymeleaf

解决方案


修复了它添加到单元格:

white-space: normal;

推荐阅读