无法设置表格高度 [英] Not able to set table height
本文介绍了无法设置表格高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的html表
我无法设置此表的高度
I have a simple html table I am not able to set the height for this table
我缺少一些东西
<table border="1" id="abc1" height="10px;" >
<tr><td><b>Name</b></td></tr>
<tr><td><b>Name</b></td></tr>
<tr><td><b>Name</b></td></tr>
<tr><td><b>Name</b></td></tr>
</table>
推荐答案
设置,实际上是CSS属性,而不是HTML。
按以下方式设置它们:
Both border and height, which you're trying to set, are actually CSS attributes, not HTML. Set them in the following way:
<table id="abc1" style="border: 1px; height:10px;" >
<tr><td><b>Name</b></td></tr>
<tr><td><b>Name</b></td></tr>
<tr><td><b>Name</b></td></tr>
<tr><td><b>Name</b></td></tr>
</table>
或者,您也可以使用如下链接的CSS样式表:
Or, alternatively, you can use a linked CSS style sheet like this:
#abc1 {
border: 1px;
height: 10px;
}
只是为了让你知道,设置table元素的高度设置高度如果要设置整个表的高度,请将该表放在div标签中,并设置该元素的高度。
你缺少什么?您缺少使用CSS设计样式的概念,请尝试以下教程: HTMLdog.com
这篇关于无法设置表格高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文