createtables.html
来自「examples ajax + php tutorial」· HTML 代码 · 共 35 行
HTML
35 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled</title>
<style type="text/css">
</style>
<script type="text/javascript">
function dotables(){
// table without tbody
var table=document.createElement('table');
var tr=document.createElement('tr');
var td=document.createElement('td')
td.appendChild(document.createTextNode('foo'));
tr.appendChild(td);
table.appendChild(tr);
document.body.appendChild(table);
// table with tbody
var table2=document.createElement('table');
var tr2=tr.cloneNode(true);
var tbody=document.createElement('tbody');
tbody.appendChild(tr2);
table2.appendChild(tbody);
document.body.appendChild(table2);
}
window.onload=dotables;
</script>
</head>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?