HTML <th> rowspan 属性
定义和用法
rowspan
属性定义标题单元格应跨越的行数。
实例
例子 1
HTML 表格包含跨越三行的标题单元格:
<table> <tr> <th>Mes</th> <th>Depósito</th> <th rowspan="3">¡Ahorros de festivos!</th> </tr> <tr> <td>enero</td> <td>¥3000</td> </tr> <tr> <td>Febrero</td> <td>¥4000</td> </tr> </table>
Ejemplo 2
Ejemplo 2: usar rowspan="0" (aplicable a Chrome, Firefox y Opera):
<table> <thead> <tr> <th>Mes</th> <th>Depósito</th> <th rowspan="3">¡Ahorros de festivos!</th> </tr> </thead> <tbody> <tr> <td>enero</td> <td>¥3000</td> <td rowspan="0">¥3500</td> </tr> <tr> <td>Febrero</td> <td>¥4000</td> </tr> </tbody> </table>
sintaxis
<th rowspan="número">
valor del atributo
valor | descripción |
---|---|
número |
Establecer el número de filas que debe cruzar la celda de título. Nota:rowspan="0" indica al navegador que la celda se extiende hasta la última fila de la sección de tabla (thead, tbody o tfoot). |
Compatibilidad con navegadores
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Soporte | Soporte | Soporte | Soporte | Soporte |