Skip to content

Instantly share code, notes, and snippets.

@evilnapsis
Created January 17, 2016 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evilnapsis/9d43cdd01762b4e81a4b to your computer and use it in GitHub Desktop.
Save evilnapsis/9d43cdd01762b4e81a4b to your computer and use it in GitHub Desktop.
<html>
<head>
<body>
<script>
var body = document.body;
var h1 = document.createElement("h1");
h1.innerHTML = "Prueba de tablas";
var table1 = document.createElement("table");
table1.border="1";
// ciclo correspondiente a la filas
for(i=0;i<10;i++){
var trx = document.createElement("tr");
// ciclo correspondiente a las columnas
for(j=0;j<5;j++){
var tdx = document.createElement("td");
tdx.innerHTML = "Fila " + i + " - Columna " + j;
trx.appendChild(tdx);
}
table1.appendChild(trx);
}
body.appendChild(h1);
body.appendChild(table1);
</script>
</head>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment