[英]How to align vertical text in a table?
I am trying to render a table that contains vertical text in its headers at the top. 我试图呈现一个表格,该表格的顶部标题包含垂直文本。 As Gecko doesn't yet support
writing-mode:vertical-rl
, I am trying to do this using transform:rotate(90deg)
. 由于Gecko尚不支持
writing-mode:vertical-rl
,因此我正在尝试使用transform:rotate(90deg)
做到这一点。 I have gotten some way to doing this: 我已经有一些方法可以做到这一点:
http://jsfiddle.net/4r3qeway/ http://jsfiddle.net/4r3qeway/
However, the text is vertically centered in the table header cells, whereas I want the text to be vertically aligned at the bottom. 但是,文本在表格标题单元格中垂直居中,而我希望文本在底部垂直对齐。 Is there any way I can do this?
有什么办法可以做到吗? Note that I can't hard-code the heights of the cells because the header cell text will change.
请注意,我无法对单元格的高度进行硬编码,因为标头单元格文本将更改。
table td {
background-color: yellow;
vertical-align:text-bottom;
}
Just added vertical-align:text-bottom;
刚刚添加了
vertical-align:text-bottom;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.