Показать сообщение отдельно
  #4 (permalink)  
Старый 17.02.2023, 16:34
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,072

Fronton,
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <style type="text/css">
        [name='1'] {
            width: 40px;
        }
    </style>
    <script>
        function add() {
            let nodet = document.createElement('tr');
            let node = document.createElement('td');
            node.innerHTML = "<input type='text' name='1'>";
            document.getElementById('tabl').append(nodet);
            for (let i = 0; i < 9; i++) nodet.appendChild(node.cloneNode(true));
        }
    </script>
</head>

<body>
    <table id='tabl' border='1' align='left'><tr>
        <th>1</th>
        <th>2</th>
        <th>3</th>
        <th>4</th>
        <th>5</th>
        <th>6</th>
        <th>7</th>
        <th>8</th>
        <th>9</th></tr>
        <tr>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
            <td><input type='text' name='1'></td>
        </tr>
    </table>
    <input type='button' value='Добавить новую строку' onClick='add();'>
</body>

</html>
Ответить с цитированием