" 2. Utilisez l'attribut style pour ajouter un style de hauteur ; à l'élément tr ou td avec la syntaxe "< tr style="height: row height value;">"."/> " 2. Utilisez l'attribut style pour ajouter un style de hauteur ; à l'élément tr ou td avec la syntaxe "< tr style="height: row height value;">".">

Maison  >  Article  >  interface Web  >  Comment définir la hauteur des lignes dans un tableau HTML

Comment définir la hauteur des lignes dans un tableau HTML

青灯夜游
青灯夜游original
2021-12-23 17:44:0625237parcourir

Comment définir la hauteur de ligne dans un tableau HTML : 1. Définissez l'attribut de hauteur sur l'élément tr ou td, syntaxe "

" ; 2. Utilisez l'attribut de style pour ajouter un style de hauteur à tr ou td, la syntaxe est " ".

Comment définir la hauteur des lignes dans un tableau HTML

L'environnement d'exploitation de ce tutoriel : système Windows 7, version HTML5, ordinateur Dell G3.

Nous avons le tableau suivant :

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

Comment définir la hauteur des lignes dans un tableau HTML

Comment régler la hauteur des lignes de ce tableau ?

1. Définissez l'attribut height sur l'élément tr ou td

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

Comment définir la hauteur des lignes dans un tableau HTML

2. Utilisez l'attribut style pour ajouter le style height à l'élément tr ou td

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

Comment définir la hauteur des lignes dans un tableau HTML

Recommandations associées : "html tutoriel vidéo"

Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn