小编Ash*_*Ash的帖子

如何对齐html表格行中的文本

这就是我想要实现的

  1. 一行中的文本。
  2. 没有白屏。
  3. 表格是可滚动的。
  4. 拉伸文本以填充单元格宽度

在此处输入图片说明

这就是我现在所拥有的

  1. 一行中的文本。
  2. 没有白屏。
  3. 表格是可滚动的。

在此处输入图片说明

我正在努力实现第 4 点

拉伸文本以填充整个表格的单元格宽度。

这是我试过的

h2 {
  font-size: 22px;
}

h3 {
  font-size: 20px;
}

h4,
p,
th,
td {
  font-size: 18px;
}

h1,
h2,
h3,
h4 {
  color: #008577;
  text-align: justify;
  margin: 10px;
}

table {
  margin: 5px
}

table,
th,
td {
  border-collapse: collapse;
}

th,
td {
  padding: 5px;
  text-align: right;
  font-family: hacen;
  border-bottom: 1px solid #ddd;
}

td {
  vertical-align: top;
}

table tr:nth-child(even) {
  background-color: #E9FCEC; …
Run Code Online (Sandbox Code Playgroud)

html css html-table

1
推荐指数
1
解决办法
144
查看次数

标签 统计

css ×1

html ×1

html-table ×1