Generate a 2000*5 table. The content of each cell is the row number + comma + column number. The specific implementation process is as follows. If you are interested, refer, we hope to help you generate a 2000*5 table. The content of each cell is the row number, comma, and column number.
Method 1: Use createElement to generate a table, use insertRow and insertCell to generate rows and columns, and use innerHTML to populate the content of cells.
Method 2: Use createElement to generate a table and CreateElement to generate rows and columns. The content of the cell is filled with the createTextNode method.
Method 3: concatenate a string in the innerHTML attribute of the table and use the string plus = Operator to link the string.
Method 4: concatenate the string of the innerHTML attribute of the table, append each string to the array, and call the join method of the array to generate the target string.
Run Time Comparison:
Method running time (MS)
Method 1 93037
Method 2 3341
Method 3 2795
Method 4 500
The specific procedure is as follows:
The Code is as follows:
Test page