HTML rowspan 屬性定義表格單元格在 HTML 文檔中應跨越的行數。它隻能應用於td或者 th HTML 元素。
用法
以下是語法 -
<tagname rowspan=”number”></tagname>
讓我們看一個 HTML rowspan 屬性的例子 -
示例
<!DOCTYPE html>
<html>
<style>
body {
color:#000;
background:lightblue;
height:100vh;
text-align:center;
}
table {
margin:2rem auto;
width:400px;
}
</style>
<body>
<h1>HTML rowspan Attribute Demo</h1>
<table border="2">
<thead>
<tr>
<th>Name</th>
<th>Language</th>
</tr>
<thead>
<tbody>
<tr>
<td>John</td>
<td>English</td>
</tr>
<tr>
<td rowspan="2">Elon</td>
<td>Germany</td>
</tr>
<tr>
<td>French</td>
</tr>
</tbody>
</table>
</body>
</html>
輸出
相關用法
- HTML rowspan屬性用法及代碼示例
- HTML rows屬性用法及代碼示例
- HTML rows屬性用法及代碼示例
- HTML reversed屬性用法及代碼示例
- HTML DOM removeAttributeNode()用法及代碼示例
- HTML readOnly屬性用法及代碼示例
- HTML referrerpolicy屬性用法及代碼示例
- HTML DOM removeAttribute()用法及代碼示例
- HTML DOM requestFullscreen()用法及代碼示例
- HTML DOM removeChild()用法及代碼示例
- HTML readonly屬性用法及代碼示例
- HTML DOM removeNamedItem()用法及代碼示例
- HTML DOM renameNode()用法及代碼示例
- HTML DOM removeEventListener()用法及代碼示例
- HTML required屬性用法及代碼示例
- HTML reserved屬性用法及代碼示例
- HTML rel屬性用法及代碼示例
- HTML DOM replaceChild()用法及代碼示例
- HTML Dialog open用法及代碼示例
注:本文由純淨天空篩選整理自AmitDiwan大神的英文原創作品 HTML rowspan Attribute。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。