colspan 屬性規定單元格可橫跨的列數 colspan="2" rowspan 屬性規定單元格可橫跨的行數 rowspan="2" ...
colspan 屬性規定單元格可橫跨的列數 colspan="2"
rowspan 屬性規定單元格可橫跨的行數 rowspan="2"
1 <!DOCTYPE html> 2 <html lang="zh-cn"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 8 <title>Demo</title> 9 </head> 10 11 <body> 12 13 <section> 14 <h1>表格</h1> 15 <table border="1"> 16 <thead> 17 <tr> 18 <th>表頭1</th> 19 <th>表頭2</th> 20 <th>表頭3</th> 21 </tr> 22 </thead> 23 <tbody> 24 <tr> 25 <td>數據1</td> 26 <td>數據2</td> 27 <td>數據3</td> 28 </tr> 29 <tr> 30 <td colspan="2">數據colspan可橫跨的列數1</td> 31 <td>數據3</td> 32 </tr> 33 <tr> 34 <td rowspan="2">數據rowspan可橫跨的行數1</td> 35 <td>數據2</td> 36 <td>數據3</td> 37 </tr> 38 <tr> 39 <td>數據2</td> 40 <td>數據3</td> 41 </tr> 42 </tbody> 43 </table> 44 </section> 45 46 </body> 47 48 </html>