سلام دوباره،
خب این با table هست.
برای نشون دادن مطلب یک table خالی گذاشتم:
<table id="tablex" border=1>
<thead>
<tr>
<th>Counter Created by CSS</th>
<th>Data</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
و با جاوااسکریپت 999 row براش درست کردم:
window.onload = function () {
const table_body = document.querySelector('#tablex tbody');
for (var i = 1; i < 1000; i++) {
var tr = table_body.insertRow(-1);
tr.insertCell(0);
var td2 = tr.insertCell(1);
td2.innerHTML = `Row ${i}`;
}
}
و این هم style :
@counter-style pad-with-3-zeros {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
pad: 3 "0";
}
#tablex {
counter-reset: row-num;
}
#tablex td {
text-align: center;
}
#tablex tbody tr td:first-child::before {
counter-increment: row-num;
content: counter(row-num, pad-with-3-zeros) " ";
color: red;
}