【发布时间】:2015-09-13 18:11:34
【问题描述】:
我正在尝试制作一个表格,其中的行只占用垂直所需的空间。有没有办法在不将最后一个单元格设置为 100% 的高度的情况下使用 CSS 来做到这一点?
这个问题与this question 非常相似,只是在另一个方向上。
目前看起来像这样:
---------------------------------
| |
|thing 1 |
| |
---------------------------------
| |
|thing 2 |
| |
---------------------------------
| |
|thing 3 |
| |
--------bottom of table----------
如何让它看起来像
---------------------------------
|thing 1 |
---------------------------------
|thing 2 |
---------------------------------
|thing 3 |
| |
| |
| |
| |
| |
| |
--------bottom of table----------
或者,或者像:
---------------------------------
|thing 1 |
---------------------------------
|thing 2 |
---------------------------------
|thing 3 |
--------bottom of table----------
-----bottom of containing div------
【问题讨论】:
-
试试
:last-child伪选择器,比如tr:last-child -
我们能否看到您的实际代码/演示来复制您遇到的间距问题?