Sin más preámbulos, le publicaré el código JS directamente. El código específico es el siguiente:
// js implementa el código fuente de la tabla automática para ingresar el número de filas y columnas de tablas <! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtdtd cuando xmlns = "http://www.w3.org/1999/xhtml"> <cead> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> Crear automáticamente tablas </title> <Style> type = "Text/css"> Table {ancho: 300px; altura: 100px; border:#0c9 1px sólido; border-colapse: colapso;} </style> <script type = "text/javaScript" lenguaje = "javascript"> function autocreate () {// create table table = documento i = 0; i <= line; i ++) {// alerta (línea); // Crear trvar tr = document.createElement ("tr"); for (var j = 0; j <= list; j ++) {// alerta (list); // Crear tdvar td = document.createElement ("td"); tr.appendChild (td);} table.appendChild (tr);} document.getElementById ("d1"). appendChild (table);} </script> </head> <body> <py type = "text" id = "line"> número de ranos <input type = "text" id = "LIST" LIST "LIST" LIST "LIST" LIST "Número de la columna =" Tipo de entrada = "Botón" Línea ". valor = "Agregar tabla" onClick = "autocreate ()"> <div id = "d1" style = "altura: 400px; ancho: 300px;"> </div> </body> </html>Lo anterior es la descripción completa de la generación automática de formularios basados en el código JavaScript introducido por el editor. Espero que te sea útil. Si tiene alguna pregunta, déjame un mensaje y el editor le responderá a tiempo. ¡Muchas gracias por su apoyo al sitio web de Wulin.com!