W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <script> function padding(id) { document.getElementById(id).style.padding = "15px"; } </script> </head> <body> <table id="myTable" style="border:1px solid black"> <tr> <td>100</td> <td>200</td> </tr> <tr> <td>300</td> <td>400</td> </tr> </table> <p> <input type="button" onclick="padding('myTable')" value="更改内边距"> </p> </body> </html>