79438556

Date: 2025-02-14 06:48:35
Score: 0.5
Natty:
Report link

table {
  counter-reset: row-counter;
  border-collapse: collapse;
  width: 50%;
  margin: 20px auto;
}

th,
td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

th {
  background-color: #f4f4f4;
}

tbody tr {
  counter-increment: row-counter;
}

tr td:first-child::before {
  content: counter(row-counter);
  margin-right: 10px;
  font-weight: bold;
}
<table>
  <thead>
    <tr>
      <th>No.</th>
      <th>ITEM</th>
      <th>PRICE</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td></td>
      <td>Banana</td>
      <td>$2</td>
    </tr>
    <tr>
      <td></td>
      <td>Orange</td>
      <td>$1</td>
    </tr>
  </tbody>
</table>

yes it is possible

for more details you can refer https://www.w3schools.com/css/css_counters.asp

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: dev.skas