html表格怎么设置行高

发布时间:2022-05-16 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了html表格怎么设置行高脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

html表格设置行高的方法:1、给tr或td元素设置height属性,语法“<tr height="行高值">”;2、利用style属性给tr或td元素添加height样式,语法“<tr style="height: 行高值;">”。

html表格怎么设置行高

本教程操作环境:windows7系统、HTML5版、Dell G3电脑。

我们有下面一个表格:

<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>

html表格怎么设置行高

怎么设置这个表格的行高?

1、通过给tr或td元素设置height属性

<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>

html表格怎么设置行高

2、利用style属性给tr或td元素添加height样式

<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表格怎么设置行高全部内容,希望文章能够帮你解决html表格怎么设置行高所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: