」;2、使用style屬性為td標籤新增「display:none」樣式,語法「」。"/> 」;2、使用style屬性為td標籤新增「display:none」樣式,語法「」。">

首頁  >  文章  >  web前端  >  html怎麼隱藏td標籤

html怎麼隱藏td標籤

青灯夜游
青灯夜游原創
2021-11-18 15:33:168081瀏覽

隱藏td標籤的方法:1、為td標籤設定hidden屬性,語法「

」;2、使用style屬性為td標籤加上「display:none」樣式,語法“ ”。

html怎麼隱藏td標籤

本教學操作環境:windows7系統、CSS3&&HTML5版、Dell G3電腦。

有這麼一個表格:

<table border="1">
	<tr>
		<th>姓名</th>
		<th>年龄</th>
	</tr>
	<tr>
		<td>Peter</td>
		<td>20</td>
	</tr>
	<tr>
		<td>Lois</td>
		<td>20</td>
	</tr>
</table>

html怎麼隱藏td標籤

想要在html中隱藏td標籤,怎麼做?以下為大家介紹一下方法:

方法1:為td標籤設定hidden屬性

<table border="1">
	<tr>
		<th>姓名</th>
		<th>年龄</th>
	</tr>
	<tr>
		<td>Peter</td>
		<td hidden="hidden">20</td>
	</tr>
	<tr>
		<td>Lois</td>
		<td>20</td>
	</tr>
</table>

html怎麼隱藏td標籤

##方法2:使用style屬性為td標籤新增「display:none;」樣式

<table border="1">
	<tr>
		<th>姓名</th>
		<th>年龄</th>
	</tr>
	<tr>
		<td>Peter</td>
		<td>20</td>
	</tr>
	<tr>
		<td>Lois</td>
		<td style="display: none;">20</td>
	</tr>
</table>

html怎麼隱藏td標籤

推薦教學:《

html影片教學

以上是html怎麼隱藏td標籤的詳細內容。更多資訊請關注PHP中文網其他相關文章!

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