运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <p>Click the button to change the value of the rowspan attribute, from 2 to 1, of th with id "myTh".</p> <table> <tr> <th id="myTh" rowspan="2">Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$100</td> </tr> </table> <br> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("myTh").rowSpan = "1"; } </script> </body> </html>