JSFiddle - React, Tailwind, and code Playground

by godhong

HTML

<html><body><table class='a' align="center">
<tr><th><label for="id_S">Number of modeled stages:</label></th><td><select name="S" id="id_S">
<option value="">Please choose</option>
<option value="2">2</option>
<option value="3">3</option>
</select></td></tr>
</table>
</body></html>

JavaScript

$(document).ready(function() {

    $('<table class="leslie" border="0" align="center"><tr><th width="5">Matrix:</th></tr></table>').insertAfter('.a'); //this works in IE8 but not in IE7
    var total=3
    i = 0
    while (i < total) {
        $('<tr><td><input type="text" size="5" name="no' + i + '" value="0" id="id_a' + i + '"/></td>').appendTo('.leslie')

        var j = 0
        while (j < total) {
            $('<td><input type="text" size="5" name="a' + i + '' + j + '" value="0" id="id_a' + i + '' + j + '"/></td>').appendTo('.leslie tr:last')
            j = j + 1
        }

        $('</tr>').appendTo('.leslie')
        i = i + 1
    }