Snippets Search

Bootstrap 5 Order Details Table with Search Filter

An order details table with live customer search, status and location filters, a result count, CSV export and pagination.

Bootstrap 5 No jQuery Nov 2019 3.5K views

<section class="wdw-stage">
  <div class="container w-100" style="max-width:1040px">
    <div class="wdw-card overflow-hidden" id="wo">
      <div class="d-flex flex-wrap align-items-center justify-content-between gap-3 p-4 border-bottom">
        <div><h2 class="h4 wdw-heading mb-1">Order details</h2><p class="wdw-muted small mb-0">Track and filter recent customer orders.</p></div>
        <div class="d-flex flex-wrap gap-2">
          <button type="button" class="btn btn-outline-secondary rounded-pill px-3" id="woExport">Export CSV</button>
          <button type="button" class="btn btn-primary rounded-pill px-3" id="woReset">Reset filters</button>
        </div>
      </div>
      <form class="row g-2 px-4 py-3 bg-body-tertiary border-bottom" role="search" id="woFilters">
        <div class="col-md-5 position-relative">
          <label for="woSearch" class="visually-hidden">Search by customer name</label>
          <svg class="wo-ico text-body-secondary" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg>
          <input id="woSearch" type="search" class="form-control ps-5" placeholder="Search customers">
        </div>
        <div class="col-6 col-md-4"><label for="woStatus" class="visually-hidden">Status</label><select id="woStatus" class="form-select"><option value="">Any status</option><option>Delivered</option><option>Shipped</option><option>Pending</option><option>Cancelled</option></select></div>
        <div class="col-6 col-md-3"><label for="woLoc" class="visually-hidden">Location</label><select id="woLoc" class="form-select"><option value="">All locations</option><option>Berlin</option><option>London</option><option>Madrid</option><option>New York</option><option>Paris</option></select></div>
      </form>
      <table class="table table-hover align-middle mb-0">
        <thead><tr><th scope="col" class="ps-4 bg-body-tertiary d-none d-md-table-cell">#</th><th scope="col" class="bg-body-tertiary ps-3 ps-md-0">Customer</th><th scope="col" class="bg-body-tertiary d-none d-md-table-cell">Location</th><th scope="col" class="bg-body-tertiary d-none d-md-table-cell">Order date</th><th scope="col" class="bg-body-tertiary d-none d-md-table-cell">Status</th><th scope="col" class="text-end bg-body-tertiary d-none d-md-table-cell">Net amount</th><th scope="col" class="pe-3 pe-md-4 text-end bg-body-tertiary">View</th></tr></thead>
        <tbody>
            <tr data-name="michael holz" data-customer="Michael Holz" data-status="Delivered" data-location="London" data-date="Jun 15, 2026" data-amount="$254">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">1</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=12" width="32" height="32" alt=""><div><span class="fw-semibold">Michael Holz</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-success-subtle text-success-emphasis"><span class="wo-dot bg-success"></span>Delivered</span><span class="small fw-semibold">$254</span></div></div></div></td>
              <td class="d-none d-md-table-cell">London</td><td class="text-body-secondary d-none d-md-table-cell">Jun 15, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-success-subtle text-success-emphasis"><span class="wo-dot bg-success"></span>Delivered</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$254</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Michael Holz"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr data-name="paula wilson" data-customer="Paula Wilson" data-status="Shipped" data-location="Madrid" data-date="Jun 21, 2026" data-amount="$1,260">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">2</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=47" width="32" height="32" alt=""><div><span class="fw-semibold">Paula Wilson</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-info-subtle text-info-emphasis"><span class="wo-dot bg-info"></span>Shipped</span><span class="small fw-semibold">$1,260</span></div></div></div></td>
              <td class="d-none d-md-table-cell">Madrid</td><td class="text-body-secondary d-none d-md-table-cell">Jun 21, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-info-subtle text-info-emphasis"><span class="wo-dot bg-info"></span>Shipped</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$1,260</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Paula Wilson"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr data-name="antonio moreno" data-customer="Antonio Moreno" data-status="Cancelled" data-location="Berlin" data-date="Jul 04, 2026" data-amount="$350">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">3</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=33" width="32" height="32" alt=""><div><span class="fw-semibold">Antonio Moreno</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis"><span class="wo-dot bg-danger"></span>Cancelled</span><span class="small fw-semibold">$350</span></div></div></div></td>
              <td class="d-none d-md-table-cell">Berlin</td><td class="text-body-secondary d-none d-md-table-cell">Jul 04, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-danger-subtle text-danger-emphasis"><span class="wo-dot bg-danger"></span>Cancelled</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$350</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Antonio Moreno"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr data-name="mary saveley" data-customer="Mary Saveley" data-status="Pending" data-location="New York" data-date="Jul 16, 2026" data-amount="$1,572">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">4</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=45" width="32" height="32" alt=""><div><span class="fw-semibold">Mary Saveley</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis"><span class="wo-dot bg-warning"></span>Pending</span><span class="small fw-semibold">$1,572</span></div></div></div></td>
              <td class="d-none d-md-table-cell">New York</td><td class="text-body-secondary d-none d-md-table-cell">Jul 16, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis"><span class="wo-dot bg-warning"></span>Pending</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$1,572</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Mary Saveley"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr data-name="martin sommer" data-customer="Martin Sommer" data-status="Delivered" data-location="Paris" data-date="Aug 04, 2026" data-amount="$580">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">5</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=15" width="32" height="32" alt=""><div><span class="fw-semibold">Martin Sommer</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-success-subtle text-success-emphasis"><span class="wo-dot bg-success"></span>Delivered</span><span class="small fw-semibold">$580</span></div></div></div></td>
              <td class="d-none d-md-table-cell">Paris</td><td class="text-body-secondary d-none d-md-table-cell">Aug 04, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-success-subtle text-success-emphasis"><span class="wo-dot bg-success"></span>Delivered</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$580</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Martin Sommer"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr data-name="elena petrova" data-customer="Elena Petrova" data-status="Shipped" data-location="Berlin" data-date="Aug 09, 2026" data-amount="$890">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">6</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=32" width="32" height="32" alt=""><div><span class="fw-semibold">Elena Petrova</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-info-subtle text-info-emphasis"><span class="wo-dot bg-info"></span>Shipped</span><span class="small fw-semibold">$890</span></div></div></div></td>
              <td class="d-none d-md-table-cell">Berlin</td><td class="text-body-secondary d-none d-md-table-cell">Aug 09, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-info-subtle text-info-emphasis"><span class="wo-dot bg-info"></span>Shipped</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$890</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Elena Petrova"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr data-name="jonas berg" data-customer="Jonas Berg" data-status="Pending" data-location="London" data-date="Aug 12, 2026" data-amount="$430">
              <td class="text-body-secondary ps-4 d-none d-md-table-cell">7</td>
              <td class="ps-3 ps-md-0"><div class="d-flex align-items-center gap-2"><img class="rounded-circle" src="https://i.pravatar.cc/64?img=52" width="32" height="32" alt=""><div><span class="fw-semibold">Jonas Berg</span><div class="d-md-none d-flex align-items-center gap-2 mt-1"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis"><span class="wo-dot bg-warning"></span>Pending</span><span class="small fw-semibold">$430</span></div></div></div></td>
              <td class="d-none d-md-table-cell">London</td><td class="text-body-secondary d-none d-md-table-cell">Aug 12, 2026</td>
              <td class="d-none d-md-table-cell"><span class="badge rounded-pill bg-warning-subtle text-warning-emphasis"><span class="wo-dot bg-warning"></span>Pending</span></td>
              <td class="fw-semibold text-end d-none d-md-table-cell wo-num">$430</td>
              <td class="pe-3 pe-md-4 text-end"><button type="button" class="btn btn-sm btn-outline-primary rounded-circle p-0" style="width:44px;min-height:44px" aria-label="View order for Jonas Berg"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></td>
            </tr>
            <tr id="woEmpty" hidden><td colspan="7" class="text-center text-body-secondary py-5">No orders match these filters.</td></tr>
        </tbody>
      </table>
      <div class="d-flex flex-wrap justify-content-between align-items-center gap-3 p-4 border-top">
        <span class="small wdw-muted" id="woCount" aria-live="polite">Showing 1–5 of 7 orders</span>
        <nav aria-label="Orders pages"><ul class="pagination mb-0 gap-1" id="woPages"></ul></nav>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.