<div class="container">
  <div class="row">
    <div class="col-12">
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th>ID</th>
            <th>Item</th>
            <th>Price</th>
            <th>Do Action</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="id-td">5841</td>
            <td class="item-td">Coffee</td>
            <td class="price-td">2.50</td>
            <td>
              <a class='btn btn-info btn-sm action-btn-id' role='button'>ID</a>
              <a class='btn btn-primary btn-sm action-btn-item' role='button'>Item</a>
              <a class='btn btn-secondary btn-sm action-btn-price' role='button'>Price</a>
            </td>
          </tr>
          <tr>
            <td class="id-td">5842</td>
            <td class="item-td">Rice</td>
            <td class="price-td">2.00</td>
            <td>
              <a class='btn btn-info btn-sm action-btn-id' role='button'>ID</a>
              <a class='btn btn-primary btn-sm action-btn-item' role='button'>Item</a>
              <a class='btn btn-secondary btn-sm action-btn-price' role='button'>Price</a>
            </td>
          </tr>
          <tr>
            <td class="id-td">5843</td>
            <td class="item-td">Bread</td>
            <td class="price-td">3.10</td>
            <td>
              <a class='btn btn-info btn-sm action-btn-id' role='button'>ID</a>
              <a class='btn btn-primary btn-sm action-btn-item' role='button'>Item</a>
              <a class='btn btn-secondary btn-sm action-btn-price' role='button'>Price</a>
            </td>
          </tr>
          <tr>
            <td class="id-td">5844</td>
            <td class="item-td">Milk</td>
            <td class="price-td">2.80</td>
            <td>
              <a class='btn btn-info btn-sm action-btn-id' role='button'>ID</a>
              <a class='btn btn-primary btn-sm action-btn-item' role='button'>Item</a>
              <a class='btn btn-secondary btn-sm action-btn-price' role='button'>Price</a>
            </td>
          </tr>
          <tr>
            <td class="id-td">5845</td>
            <td class="item-td">Flour</td>
            <td class="price-td">2.65</td>
            <td>
              <a class='btn btn-info btn-sm action-btn-id' role='button'>ID</a>
              <a class='btn btn-primary btn-sm action-btn-item' role='button'>Item</a>
              <a class='btn btn-secondary btn-sm action-btn-price' role='button'>Price</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
$(".action-btn-id").on("click", function () {
  let id = $(this).closest("tr").find(".id-td").text();
  alert(id);
});

$(".action-btn-item").on("click", function () {
  let item = $(this).closest("tr").find(".item-td").text();
  alert(item);
});

$(".action-btn-price").on("click", function () {
  let price = $(this).closest("tr").find(".price-td").text();
  alert(price);
});

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.2/css/bootstrap.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js