"; 2. Use the style attribute to add the height style to the tr or td element with the syntax "< tr style="height: row height value;">"."/> "; 2. Use the style attribute to add the height style to the tr or td element with the syntax "< tr style="height: row height value;">".">

Home  >  Article  >  Web Front-end  >  How to set row height in html table

How to set row height in html table

青灯夜游
青灯夜游Original
2021-12-23 17:44:0625319browse

How to set row height in html table: 1. Set height attribute to tr or td element, syntax "

"; 2. Use style attribute to tr or td Add a height style to the element with the syntax " ".

How to set row height in html table

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

We have the following table:

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

How to set row height in html table

How to set the row height of this table?

1. Set the height attribute to the tr or td element

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

How to set row height in html table

##2. Use the style attribute to add the height style to the tr or td element

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

How to set row height in html table

Related recommendations: "

html video tutorial"

The above is the detailed content of How to set row height in html table. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn