The appendChild method is used to add columns and display the results in the same sequence as the program execution.
For details, run the following code:
Copy codeThe Code is as follows:
<Html>
<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 = "James ";
CellObj = rowObj. insertCell ();
CellObj. innerHTML = "please refer to the script features of other bibliography I have compiled for reference to other bibliography I have compiled ";
CellObj = rowObj. insertCell ();
CellObj. innerHTML = "Please check the client address information in a small room. ";
}
Function generatable1 (){
Var tableObje = document. getElementById ("info ");
Var bodyObj = tableObje. tBodies [0];
Var rowObj = document. createElement ("tr ");
Var cellObj = document. createElement ("td ");
CellObj. innerHTML = "James ";
RowObj. appendChild (cellObj)
CellObj = document. createElement ("td ");
CellObj. innerHTML = "please refer to the script features of other bibliography I have compiled for reference to other bibliography I have compiled ";
RowObj. appendChild (cellObj );
CellObj = document. createElement ("td ");
CellObj. innerHTML = "Please check the client address information in a small room. ";
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>
</Html>