多行表始终垂直居中内容
我基本上有一个包含 2 行的表格,它看起来像这样:
---------
| | |
| | |
| | |
|--------
我的问题是第二行自动垂直居中,如下所示:
|hey| |
|hey|hey|
|hey| |
|--------
现在我如何添加段落,直到它变成另一个段落的大小:
|hey|hey|
|hey| |
|hey| |
|--------
如何我使用CSS正确地做到了这一点吗?
I've basically got a table with 2 rows and it looks like this:
---------
| | |
| | |
| | |
|--------
My problem is that the second row auto centers vertically like this:
|hey| |
|hey|hey|
|hey| |
|--------
How so right now I'm adding paragraphs until it just becomes the size of the other:
|hey|hey|
|hey| |
|hey| |
|--------
How can I do this correctly using CSS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这就是您正在寻找的:
但是,如果您希望所有表格单元格将其内容与顶部对齐,则不应定义内联样式,而应将 a 添加
到 CSS 样式表中。
I think this is what you're looking for:
However, if you want all table cells to align their content to the top, you should not define the style inline, but rather add a
to your CSS stylesheet.
使用垂直对齐:顶部
Use Vertical allign: Top