Using the AppendChild method to add columns, the results are displayed in the same order as the program executes
The following code can be executed in detail:
Copy Code code as follows:
<script type= "Text/javascript" ><!--
function generatable () {
var tableobje = document.getElementById ("info");
var bodyobj = tableobje.tbodies[0];
var rowobj = Bodyobj.insertrow ();
var cellobj = Rowobj.insertcell ();
cellobj.innerhtml = "John";
Cellobj = Rowobj.insertcell ();
cellobj.innerhtml = "See the scripting features for other bibliographies I have written for see other bibliographies I have written";
Cellobj = Rowobj.insertcell ();
cellobj.innerhtml = "Client address information please small room is also view." ";
}
function Generatable1 () {
var tableobje = document.getElementById ("info");
var bodyobj = tableobje.tbodies[0];
var rowobj = document.createelement ("tr");
var cellobj = document.createelement ("TD");
cellobj.innerhtml = "John";
Rowobj.appendchild (Cellobj)
Cellobj = document.createelement ("TD");
cellobj.innerhtml = "See the scripting features for other bibliographies I have written for see other bibliographies I have written";
Rowobj.appendchild (Cellobj);
Cellobj = document.createelement ("TD");
cellobj.innerhtml = "Client address information please small room is also view." ";
Rowobj.appendchild (Cellobj);
Bodyobj.appendchild (Rowobj);
}
--></script>
<body onload= "generatable ()" >
<table width=100 bgcolor= #f3f3f3 id=info border=1 style= "table-layout:fixed;" style= "table-layout:fixed;" >
<thead>
<tr>
<TD style= "width:80" > Name </td>
<TD style= "width:200" > Description </td>
<TD style= "width:100" > Address </td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</body>