File "table005.php"

Full Path: /home/analogde/www/Design/Dev tableau/table005.php
File size: 1.87 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.0">
    <title>Tableau HTML</title>
    <style>
        .table-container {
            width: 100%;
            overflow-x: auto;
        }
        table {
            border-collapse: collapse;
            white-space: nowrap;
        }
        th, td {
            border: 1px solid black;
            padding: 5px;
            text-align: center;
        }
        .fixed-column {
            position: sticky;
            left: 0;
            background: white;
            z-index: 2;
            border-left: 2px solid black; /* Bordure gauche toujours visible */
            border-right: 2px solid black; /* Bordure droite toujours visible */
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
            padding-left: 5px;
            padding-right: 5px;
        }
        .fixed-column::before, .fixed-column::after {
            content: "";
            position: absolute;
            top: 0;
            width: 2px;
            height: 100%;
            background: black;
        }
        .fixed-column::before {
            left: -2px; /* Assure la bordure gauche */
        }
        .fixed-column::after {
            right: -2px; /* Assure la bordure droite */
        }
    </style>
</head>
<body>
    <div class="table-container">
        <table>
            <?php 
                $rows = ['toto', 'titi', 'lulu'];
                $columns = 200; 
                foreach ($rows as $row) {
                    echo "<tr><td class='fixed-column'>$row</td>";
                    for ($i = 0; $i < $columns; $i++) {
                        echo "<td>0</td>";
                    }
                    echo "</tr>";
                }
            ?>
        </table>
    </div>
</body>
</html>