」;2、利用style屬性為tr或td元素新增height樣式,語法「< tr style="height: 行高值;">」。"/> 」;2、利用style屬性為tr或td元素新增height樣式,語法「< tr style="height: 行高值;">」。">

首頁  >  文章  >  web前端  >  html表格怎麼設定行高

html表格怎麼設定行高

青灯夜游
青灯夜游原創
2021-12-23 17:44:0625236瀏覽

html表格設定行高的方法:1、給tr或td元素設定height屬性,語法「

」;2、利用style屬性給tr或td元素加入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表格怎麼設定行高的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn