JavaScript使用函数创建表格
<button onclick="formStuden()">点我创建表格</button>
<script>
function formStuden() {
//创建表
var atb = document.createElement('table');
document.body.appendChild(atb);
//创建表名字
var os = document.createElement('caption');
atb.appendChild(os);
os.innerHTML = ('学生信息表');
//创建表头
var ot = document.createElement('thead');
atb.appendChild(ot)