Creacion de nueva rama clase 11 #1

Open
ojeda.alexis wants to merge 2 commits from ojeda.alexis/clase-11-ejercicio-integrador:prueba-examen-clase-11 into main
2 changed files with 18 additions and 2 deletions
Showing only changes of commit 8c2458103e - Show all commits

View File

@@ -53,6 +53,12 @@ th, td {
border-bottom: 1px solid #e0e0e0;
}
/* Centrar columnas específicas (Año y Puntaje) */
th:nth-child(3), td:nth-child(3),
th:nth-child(4), td:nth-child(4) {
text-align: center;
}
th {
background-color: #4a69bd;
color: white;

View File

@@ -7,8 +7,18 @@ let libros = [
function mostrarTabla(datos) {
// Escribir esta función para resolver el punto 1.
const libreria = document.querySelector("#listado_libros");
for (const libro of libros){
const fila = document.createElement("tr");
fila.innerHTML = `
<td>${libro.titulo}</td>
<td>${libro.autor}</td>
<td>${libro.anio}</td>
<td>${libro.puntaje}</td>
`;
libreria.appendChild(fila);
}
}
// Invocamos la función al inicio para poblar la tabla con los datos del array
mostrarTabla(libros);