html中colspan有什么用
生活随笔
收集整理的這篇文章主要介紹了
html中colspan有什么用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
小編給大家分享一下html中colspan有什么用,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
colspan是html表格標簽<table>里面<td>或<th>標簽的標簽屬性,其屬性是設置當前單元格橫跨的列數。
colspan實例
表格單元橫跨兩列的表格:
<tableborder="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <tdcolspan="2">January</td> </tr> <tr> <tdcolspan="2">February</td> </tr> </table>
colspan定義和用法
colspan屬性規定單元格可橫跨的列數。
colspan通常使用在td與th標簽中。
如:
<tableborder="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <tdcolspan="2">January</td> </tr> <tr> <tdcolspan="2">February</td> </tr> </table>
瀏覽器支持
所以瀏覽器都支持colspan屬性。
沒有瀏覽器支持colspan="0",這個值有特殊的意義。(參見屬性值表格中的描述)
語法
<tdcolspan="value">
屬性值
值描述
number
設置單元格可橫跨的列數。
注釋:colspan="0"指示瀏覽器橫跨到列組的最后一列。
總結
以上是生活随笔為你收集整理的html中colspan有什么用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 插入区间Python解法
- 下一篇: 螺旋矩阵 IIPython解法