案例:javascript案例     状态:可编辑再运行    进入横版
x
document.getElementById("myTr").appendChild(x);
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style>
5
table,th
6
{
7
border:1px solid black;
8
}
9
</style>
10
</head>
11
<body>
12
13
<table id="myTable">
14
  <tr id="myTr">
15
  </tr>
16
</table>
17
18
<h3>演示如何创建 TH 元素</h3>
19
20
<p>点击按钮来创建 TH 元素。</p>
21
22
<button onclick="myFunction()">亲自试一试</button>
23
24
<script>

 运行结果 
 北美留学生论坛