JavaScript -- Table-方法

时间:2022-12-22 05:59:43

-----049-Table-方法.html-----

 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <title>标题</title>
 </head>
 <body>
 <table id="bios" border="1">
     <tr>
         <td>Standard CMOS Setup</td>
         <td>标准CMOS设定</td>
     </tr>
     <tr>
         <td>BIOS Features Setup</td>
         <td>BIOS功能设定</td>
     </tr>
     <tr>
         <td>Chipset Features Setup</td>
         <td>芯片组功能设定</td>
     </tr>
     <tr>
         <td>Power Management Setup</td>
         <td>节点功能设定</td>
     </tr>
     <tr>
         <td>PNP/PCI Configuration Setup</td>
         <td>即插即用与PCI设定</td>
     </tr>
 </table>
 <script type="text/javascript">
     t = document.getElementById("bios");
 </script>
 <button onclick="t.createCaption().innerHTML='AWARD BIOS'">创建说明</button>
 <button onclick="t.deleteCaption()">删除说明</button><br/>
 <button onclick="row=t.createTHead().insertRow(0); row.insertCell(0).innerHTML='BIOS项目'; row.insertCell(1).innerHTML='中文解释'">创建表头</button>
 <button onclick="t.deleteTHead()">删除表头</button>
 <button onclick="row=t.createTFoot().insertRow(0); row.insertCell(0).innerHTML='Press F10 To Save'; row.insertCell(1).innerText='按下F10保存设定'">创建表脚</button>
 <button onclick="t.deleteTFoot()">删除表脚</button><br/>
 <button onclick="row=t.insertRow(0); row.insertCell(0).innerHTML='抢占二楼'; row.insertCell(1).innerHTML='前排卖瓜子'">首行插入</button>
 <button onclick="t.deleteRow(0)">首行删除</button>
 <button onclick="row=t.insertRow(); row.insertCell(0).innerHTML='查水表的来了'; row.insertCell(1).innerHTML='大家快。。。啊。。。'">尾行插入</button>
 <button onclick="t.deleteRow()">尾行删除</button>
 </body>
 </html>

JavaScript -- Table-方法