valign不工作在td? [英] valign not working on a td?
问题描述
我有一个表格,其中包含一个表单,在左边的col是该字段的名称,我想设置文本到td的顶部,因为在文本是在底部。 / p>
有没有人知道为什么这是一个hit和miss元素属性?
首先,
你不应该真正使用表格布局(即使是表单),你应该使用 div
s和CSS:
如何在Internet Explorer中在完整高度表中创建完整高度单元格
其次,
valign
已弃用,我们现在使用css属性 vertical-align
使用 valign
:
http:// phrogz。 net / css / vertical-align / index.html
HMTL:
< div class =className> Blah< / div>
CSS:
.className {
vertical-align:middle;
}
I have a table that contains a form, in the left col is the name of the field, and i would like to set the text to the top of the td, as at the moment the text is at the bottom.
Does any one know why this is a hit and miss element attribute?
Firstly,
You shouldn't really be using tables for layout (even for forms) you should use div
s and CSS:
how to make full height cell in full height table in Internet Explorer
Secondly,
valign
was deprecated, we now use the css property vertical-align
see why not to use valign
:
http://phrogz.net/css/vertical-align/index.html
HMTL:
<div class="className">Blah</div>
CSS:
.className {
vertical-align: middle;
}
这篇关于valign不工作在td?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!