如何对齐表格单元格的内容在顶部? [英] How to align the table cells content on the top?

查看:226
本文介绍了如何对齐表格单元格的内容在顶部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML表格。每个单元格都有不同长度的内容。

I have a HTML table. Each cell has content of different length.

因此,内容不在顶部。

For this reason, the content is not aligned on the top.

我希望第一行也在具有少许文本行的单元格中对齐(内容应始终从顶部开始)。

I would like the first lines be aligned also in cells with few lines of text (the content should always start from the top).

而是内容垂直居中在中间。

Instead the content is vertically centered in the middle.

如何解决这个问题(跨浏览器解决方案.. )

How can I fix this (a cross-browser solution.. working in I.E. as well)

感谢

推荐答案


$ b

in css

td, th {
vertical-align:top;
}

这篇关于如何对齐表格单元格的内容在顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆