本教程操作环境:windows7系统、HTML5版、Dell G3电脑。
我们有下面一个表格:
复制代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<table border="1">
<tr>
<th>商品</th>
<th>价格</th>
</tr>
<tr>
<td>T恤</td>
<td>¥100</td>
</tr>
<tr>
<td>牛仔褂</td>
<td>¥250</td>
</tr>
<tr>
<td>牛仔库</td>
<td>¥150</td>
</tr>
</table>
登录后复制
怎么设置这个表格的行高?
1、通过给tr或td元素设置height属性
复制代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<table border="1">
<tr>
<th>商品</th>
<th>价格</th>
</tr>
<tr height="100">
<td>T恤</td>
<td>¥100</td>
</tr>
<tr>
<td height="50">牛仔褂</td>
<td>¥250</td>
</tr>
<tr>
<td>牛仔库</td>
<td>¥150</td>
</tr>
</table>
登录后复制
2、利用style属性给tr或td元素添加height样式
复制代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<table border="1">
<tr>
<th>商品</th>
<th>价格</th>
</tr>
<tr style="height: 50px;">
<td>T恤</td>
<td>¥100</td>
</tr>
<tr>
<td style="height: 60px;">牛仔褂</td>
<td>¥250</td>
</tr>
<tr>
<td>牛仔库</td>
<td>¥150</td>
</tr>
</table>
登录后复制
相关推荐:《html视频教程》
以上就是html表格怎么设置行高的详细内容,更多请关注靠谱客其它相关文章!
最后
以上就是瘦瘦鸡翅最近收集整理的关于html表格怎么设置行高的全部内容,更多相关html表格怎么设置行高内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复