更新时间:2023-12-03 11:26:10
您要使用CSS white-space:pre
适当< td>
。要对所有表单元格执行此操作,例如:
You want to use the CSS white-space:pre
applied to the appropriate <td>
. To do this to all table cells, for example:
td { white-space:pre }
或者,如果您可以更改标记,可以使用 < pre>
标记。默认情况下,Web浏览器使用其用户代理样式表将相同的 white-space:pre
规则应用于此元素。
Alternatively, if you can change your markup, you can use a <pre>
tag around your content. By default web browsers use their user-agent stylesheet to apply the same white-space:pre
rule to this element.
PRE元素告诉可视用户代理,所包含的文本是预格式化的。处理预先设定的文字时,可视用户代理:
The PRE element tells visual user agents that the enclosed text is "preformatted". When handling preformatted text, visual user agents: