File "test02.html"

Full Path: /home/analogde/www/WORDPRESS/Dev tableau/test02.html
File size: 3.11 KB
MIME-type: text/html
Charset: utf-8

<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Tableau Bootstrap</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .table-responsive {
            overflow-x: auto;
            white-space: nowrap;
        }
        th, td {
            border: 1px solid #dee2e6;
            background-clip: padding-box;
        }
        th:nth-child(1), td:nth-child(1) {
            position: sticky;
            left: 0;
            background: white;
            z-index: 3;
            border-right: 2px solid #dee2e6;
        }
        th:nth-child(2), td:nth-child(2) {
            position: sticky;
            left: 100px; /* Ajuster selon la largeur de la première colonne */
            background: white;
            z-index: 3;
            border-right: 2px solid #dee2e6;
        }
        th:nth-child(3), td:nth-child(3) {
            position: sticky;
            left: 200px; /* Ajuster pour la deuxième colonne */
            background: white;
            z-index: 2;
            border-right: 2px solid #dee2e6;
        }
    </style>
</head>
<body>
    <div class="container-fluid mt-4">
        <div class="table-responsive">
            <table class="table table-bordered table-striped w-100">
                <thead>
                    <tr>
                        <th style="min-width: 100px;">Titre</th>
                        <th style="min-width: 100px;">col1</th>
                        <th style="min-width: 100px;">Total</th>
                        <th>col2</th>
                        <script>
                            for (let i = 3; i <= 200; i++) {
                                document.write(`<th>col${i}</th>`);
                            }
                        </script>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>Titre 1</td>
                        <td>Donnée 1</td>
                        <td>Total 1</td>
                        <td>Donnée 2</td>
                        <script>
                            for (let i = 3; i <= 200; i++) {
                                document.write(`<td>Donnée ${i}</td>`);
                            }
                        </script>
                    </tr>
                    <tr>
                        <td>Titre 2</td>
                        <td>Donnée A</td>
                        <td>Total 2</td>
                        <td>Donnée B</td>
                        <script>
                            for (let i = 3; i <= 200; i++) {
                                document.write(`<td>Donnée ${String.fromCharCode(64 + (i % 26))}</td>`);
                            }
                        </script>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>