File "table0012.php"
Full Path: /home/analogde/www/Design/Dev tableau/table0012.php
File size: 1.66 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;
width: 100%;
table-layout: auto; /* Permet aux colonnes de s'ajuster automatiquement */
}
th, td {
border: 1px solid black;
padding: 5px;
text-align: center;
}
/* Fixer la largeur de la première colonne */
.fixed-column {
position: sticky;
left: 0;
background: white;
z-index: 2;
border-left: 1px solid black;
border-right: 1px solid black;
box-shadow: 1px 0 3px rgba(0, 0, 0, 0.2);
padding-left: 0;
padding-right: 0;
width: 222px; /* Largeur fixée à 222px pour la première colonne */
min-width: 222px; /* Empêche la réduction de la largeur */
}
</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>