En fait, j'avais pas fait attention. Ton code ne va pas du tout. Je t'ai corrigé ton code. À toi de faire le reste (css). Ton :before ==> oublie à tout jamais.
<table id="table_items">
<?php for($i = 1; $i <= 4; $i++): ?>
<tr>
<th scope="row"><label for="label_<?= $i ?>">Libellé</label></th>
<td><input type="text" class="input-text" placeholder="Libellé" name="label_<?= $i ?>" id="label_<?= $i ?>" value="" required /></td>
</tr>
<tr>
<th scope="row"><label for="description_<?= $i ?>">Description</label></th>
<td><input type="text" class="input-text" placeholder="Description" id="description_<?= $i ?>" name="description_<?= $i ?>" value="" required /></td>
</tr>
<tr>
<th scope="row">Modifier</th>
<td><span class='update_item'><img src="http://lorempixel.com/16/16" alt="modifier" class="img-update" /></span></td>
</tr>
<tr>
<th scope="row">Supprimer</th>
<td><span class='delete_item'><img src="http://lorempixel.com/16/16" alt="supprimer" class="img-delete" /></span></td>
</tr>
<tr>
<th scope="row">Visualiser</th>
<td><a href="view_item.php" target="_blank"><img src="http://lorempixel.com/16/16" alt="visualiser" class="img-view" /></a></td>
</tr>
<tr>
<th scope="row">Configurer</th>
<td><a href="custom_item.php" target="_blank"><img src="http://lorempixel.com/16/16" alt="configurer" class="img-setup" /></a></td>
</tr>
<?php endfor; ?>
</table>
css
table {
width: 100%;
padding: 0 5px;
margin: 0 auto;
border-collapse: collapse;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: #eee;
}
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 35%;
}
/*beurk ! */
/* td:before {
position: absolute;
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
content: attr(data-column);
color: #000;
font-weight: bold;
} */
td, th {
font-size: 12px;
padding-bottom: 2px;
padding-top: 2px;
border: 1px solid #ccc;
text-align: left;
}
th {
background: #3498db;
color: white;
font-weight: bold;
}
#item_rows .input-text
{
height: 1rem;
font-size: 12px;
}
a {
text-decoration: none;
cursor: pointer;
color: #fff;
}
#table_items a, #table_items a img{display:block}
a:hover {
opacity: 0.8;
}
.img-view, .img-update, .img-delete, .img-setup {
width: 16px;
height: 16px;
margin-left: 16px;
}
.img-view:hover, .img-update:hover, .img-delete:hover, .img-setup:hover {
cursor: pointer;
}
#table_items a, #table_items a img, #table_items span, #table_items span img {
display: block;
}
Modifié par niuxe (29 Sep 2020 - 23:33)