菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <script> function displayResult(){ document.getElementById("myTable").style.tableLayout="fixed"; } </script> </head> <body> <table id="myTable" width="300" border="1"> <thead> <th>表格表头</th> <th>表格表头</th> </thead> <tbody> <tr> <td>这是一些文本。这是一些文本。</td> <td>这是另一些文本</td> </tr> </tbody> </table> <br> <button type="button" onclick="displayResult()">设置固定的表格布局</button> </body> </html>
运行结果