Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cbea2cb9f |
27
script.js
27
script.js
@@ -7,6 +7,33 @@ let libros = [
|
||||
|
||||
function mostrarTabla(datos) {
|
||||
// Escribir esta función para resolver el punto 1.
|
||||
const datosTabla = document.querySelector("#datos-libros");
|
||||
|
||||
for (const libro of libros) {
|
||||
const fila = document.createElement("tr");
|
||||
|
||||
const titulo = document.createElement("td");
|
||||
titulo.textContent = libro.titulo;
|
||||
|
||||
const autor = document.createElement("td");
|
||||
autor.textContent = libro.autor;
|
||||
|
||||
const anio = document.createElement("td");
|
||||
anio.textContent = libro.anio;
|
||||
|
||||
const puntaje = document.createElement("td");
|
||||
puntaje.textContent = libro.puntaje;
|
||||
|
||||
fila.appendChild(titulo);
|
||||
fila.appendChild(autor);
|
||||
fila.appendChild(anio);
|
||||
fila.appendChild(puntaje);
|
||||
|
||||
datosTabla.appendChild(fila);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user