Tabla con js

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tabla y Modales</title>
   
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <table id="solicitudtabla" class="table">
        <thead class="thead-dark">
            <tr>
                <th>Id</th>
                <th>Carpeta</th>
                <th>Registro</th>
                <th>Solicitud</th>
                <th>Fecha de Registro</th>
                <th>Plazo/Comentario</th>
                <th>Fecha de Vencimiento</th>
                <th>Estado</th>
                <th>Resolvio</th>
                <th>Fecha de Contesto</th>
            </tr>
        </thead>
        <tbody id="tablaBody"></tbody>
    </table>

    <script>
        const datos = [
            {id: 1, carpeta: 'Registro 1', registro: 'a', solicitud: 2, f_registro: 'Registro 2', comentario: 'a', f_vence: 'a', Estado: 'a', resolvio: 'a', f_contesto: 'f_contesto'}
        ];

        function pintarTabla(datos) {
            let tablaHTML = '';

            datos.forEach(dato => {
                tablaHTML += `
                    <tr>
                        <td>${dato.id}</td>
                        <td>${dato.carpeta}</td>
                        <td>${dato.registro}</td>
                        <td>${dato.solicitud}</td>
                        <td>${dato.f_registro}</td>
                        <td>${dato.comentario}</td>
                        <td>${dato.f_vence}</td>
                        <td>${dato.Estado}</td>
                        <td>${dato.resolvio}</td>
                        <td>${dato.f_contesto}</td>
                    </tr>
                `;
            });

            document.getElementById('tablaBody').innerHTML = tablaHTML;
        }

        pintarTabla(datos);
    </script>
</body>
</html>

Comentarios

Entradas populares de este blog

Filtrando por fecha

10 videojuegos gratis para aprender JavaScript en línea

reloj obs---datetime.lua