【问题标题】:I have a Table which is so wide to an A4 paper size and i want this Table to be vertical in HTML [duplicate]我有一个宽到 A4 纸大小的表格,我希望这个表格在 HTML 中是垂直的 [重复]
【发布时间】:2021-02-20 16:53:26
【问题描述】:

我有一张这样的桌子

A header Another header
A1 B1
A2 B2
A3 B3

我希望它是这样的

A header A1 A2
Another header B1 B2
Another header C1 C2

我正在使用 Thymeleaf,所以如果我使用正常的方式单独编写每一行,它就无法工作,因为有时我的 1 列多于一行,所以我需要一种方法来处理 Thymeleaf 条件<span th:text="${{ .....}}"></span>

【问题讨论】:

标签: java html css thymeleaf


【解决方案1】:

您可以定义表格的列宽

<table border="solid">
  <tr>
    <th width="100">A header</th>
    <th width="150">Another header</th>
  </tr>
  <tr>
    <td>A1</td>
    <td>B1</td>
  </tr>
  <tr>
    <td>A2</td>
    <td>B2</td>
  </tr>
  <tr>
    <td>A3</td>
    <td>B3</td>
  </tr>
</table>

【讨论】:

  • 谢谢,但我编辑了这个问题,这在我的情况下不起作用,因为这样我可能有每个标题 3 或具有相同标题名称的行
  • 抱歉,我没用过百里香叶,所以在这里帮不了你。
猜你喜欢
  • 2017-02-12
  • 1970-01-01
  • 2012-07-25
  • 2018-05-14
  • 2016-07-28
  • 1970-01-01
  • 2014-03-21
  • 2013-06-08
相关资源
最近更新 更多