Snippets Table

Bootstrap 5 Tabs with Data Table

A tabbed data table that groups projects into Active, In review and Completed views, with progress bars and status badges.

Bootstrap 5 No jQuery Nov 2020 4.3K views

<section class="wdw-stage">
  <div class="container" style="max-width: 1100px;">
    <div class="d-flex flex-wrap align-items-end justify-content-between gap-3 mb-4">
      <div>
        <span class="wdw-eyebrow">Workspace</span>
        <h2 class="wdw-heading h2 mt-1 mb-0">Project overview</h2>
      </div>
      <div class="d-flex gap-2 w-100 w-md-auto pt-toolbar">
        <div class="input-group">
          <span class="input-group-text bg-body border-end-0" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg></span>
          <input type="search" class="form-control border-start-0 ps-0" placeholder="Search projects" aria-label="Search projects">
        </div>
        <button type="button" class="btn btn-outline-primary rounded-pill px-3">Filter</button>
      </div>
    </div>
    <div class="row g-3 mb-4">
      <div class="col-4"><div class="wdw-card-sm p-3 p-md-4"><div class="small wdw-muted">Active</div><div class="h2 fw-bold mb-0 text-body-emphasis">3</div></div></div>
      <div class="col-4"><div class="wdw-card-sm p-3 p-md-4"><div class="small wdw-muted">In review</div><div class="h2 fw-bold mb-0 text-body-emphasis">2</div></div></div>
      <div class="col-4"><div class="wdw-card-sm p-3 p-md-4"><div class="small wdw-muted">Completed</div><div class="h2 fw-bold mb-0 text-body-emphasis">3</div></div></div>
    </div>
    <div class="wdw-card overflow-hidden">
      <div class="px-2 px-md-4 pt-2 border-bottom">
        <ul class="nav nav-fill pt-tabs" id="projectTabs" role="tablist">
          <li class="nav-item flex-fill" role="presentation">
            <button class="nav-link w-100 active" id="tab-active-btn" data-bs-toggle="tab" data-bs-target="#tab-active" type="button" role="tab" aria-controls="tab-active" aria-selected="true">Active <span class="badge rounded-pill text-bg-primary ms-1" data-count>3</span></button>
          </li>
          <li class="nav-item flex-fill" role="presentation">
            <button class="nav-link w-100" id="tab-review-btn" data-bs-toggle="tab" data-bs-target="#tab-review" type="button" role="tab" aria-controls="tab-review" aria-selected="false" tabindex="-1">In review <span class="badge rounded-pill text-bg-secondary ms-1" data-count>2</span></button>
          </li>
          <li class="nav-item flex-fill" role="presentation">
            <button class="nav-link w-100" id="tab-done-btn" data-bs-toggle="tab" data-bs-target="#tab-done" type="button" role="tab" aria-controls="tab-done" aria-selected="false" tabindex="-1">Completed <span class="badge rounded-pill text-bg-secondary ms-1" data-count>3</span></button>
          </li>
        </ul>
      </div>
      <div class="tab-content">
        <div class="tab-pane fade show active" id="tab-active" role="tabpanel" aria-labelledby="tab-active-btn" tabindex="0">
          <div class="table-responsive">
            <table class="table table-hover align-middle mb-0 pt-table">
              <thead><tr><th scope="col">Project</th><th scope="col" class="d-none d-md-table-cell">Owner</th><th scope="col">Progress</th><th scope="col" class="text-end">Status</th></tr></thead>
              <tbody>
                <tr><th scope="row"><span class="d-block">Website redesign</span><span class="d-md-none small fw-normal text-body-secondary">Maya Doe</span></th><td class="d-none d-md-table-cell"><span class="d-inline-flex align-items-center gap-2"><span class="pt-avatar rounded-circle bg-primary-subtle text-primary-emphasis" aria-hidden="true">MD</span><span>Maya Doe</span></span></td><td><div class="d-flex align-items-center gap-2"><div class="progress flex-grow-1" role="progressbar" aria-label="Website redesign progress" aria-valuenow="72" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar" style="width:72%"></div></div><span class="small fw-semibold pt-pct">72%</span></div></td><td class="text-end"><span class="badge rounded-pill fs-xs bg-success-subtle text-success-emphasis">On track</span></td></tr>
                <tr><th scope="row"><span class="d-block">Mobile app v2</span><span class="d-md-none small fw-normal text-body-secondary">Leo Moe</span></th><td class="d-none d-md-table-cell"><span class="d-inline-flex align-items-center gap-2"><span class="pt-avatar rounded-circle bg-primary-subtle text-primary-emphasis" aria-hidden="true">LM</span><span>Leo Moe</span></span></td><td><div class="d-flex align-items-center gap-2"><div class="progress flex-grow-1" role="progressbar" aria-label="Mobile app v2 progress" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar" style="width:45%"></div></div><span class="small fw-semibold pt-pct">45%</span></div></td><td class="text-end"><span class="badge rounded-pill fs-xs bg-warning-subtle text-warning-emphasis">At risk</span></td></tr>
                <tr><th scope="row"><span class="d-block">Brand guidelines</span><span class="d-md-none small fw-normal text-body-secondary">Ana Dooley</span></th><td class="d-none d-md-table-cell"><span class="d-inline-flex align-items-center gap-2"><span class="pt-avatar rounded-circle bg-primary-subtle text-primary-emphasis" aria-hidden="true">AD</span><span>Ana Dooley</span></span></td><td><div class="d-flex align-items-center gap-2"><div class="progress flex-grow-1" role="progressbar" aria-label="Brand guidelines progress" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar" style="width:90%"></div></div><span class="small fw-semibold pt-pct">90%</span></div></td><td class="text-end"><span class="badge rounded-pill fs-xs bg-success-subtle text-success-emphasis">On track</span></td></tr>
              </tbody>
            </table>
          </div>
        </div>
        <div class="tab-pane fade" id="tab-review" role="tabpanel" aria-labelledby="tab-review-btn" tabindex="0">
          <div class="table-responsive">
            <table class="table table-hover align-middle mb-0 pt-table">
              <thead><tr><th scope="col">Project</th><th scope="col" class="d-none d-md-table-cell">Reviewer</th><th scope="col" class="d-none d-md-table-cell">Submitted</th><th scope="col" class="text-end">Status</th></tr></thead>
              <tbody>
                <tr><th scope="row"><span class="d-block">Pricing page copy</span><span class="d-md-none small fw-normal text-body-secondary">Sam Carter · Oct 24</span></th><td class="d-none d-md-table-cell"><span class="d-inline-flex align-items-center gap-2"><span class="pt-avatar rounded-circle bg-primary-subtle text-primary-emphasis" aria-hidden="true">SC</span><span>Sam Carter</span></span></td><td class="d-none d-md-table-cell">Oct 24</td><td class="text-end"><span class="badge rounded-pill fs-xs bg-primary-subtle text-primary-emphasis">Awaiting</span></td></tr>
                <tr><th scope="row"><span class="d-block">Onboarding emails</span><span class="d-md-none small fw-normal text-body-secondary">Priya Nair · Oct 26</span></th><td class="d-none d-md-table-cell"><span class="d-inline-flex align-items-center gap-2"><span class="pt-avatar rounded-circle bg-primary-subtle text-primary-emphasis" aria-hidden="true">PN</span><span>Priya Nair</span></span></td><td class="d-none d-md-table-cell">Oct 26</td><td class="text-end"><span class="badge rounded-pill fs-xs bg-primary-subtle text-primary-emphasis">Awaiting</span></td></tr>
              </tbody>
            </table>
          </div>
        </div>
        <div class="tab-pane fade" id="tab-done" role="tabpanel" aria-labelledby="tab-done-btn" tabindex="0">
          <div class="table-responsive">
            <table class="table table-hover align-middle mb-0 pt-table">
              <thead><tr><th scope="col">Project</th><th scope="col" class="d-none d-md-table-cell">Client</th><th scope="col" class="d-none d-md-table-cell">Delivered</th><th scope="col" class="text-end">Award</th></tr></thead>
              <tbody>
                <tr><th scope="row"><span class="d-block">Annual report</span><span class="d-md-none small fw-normal text-body-secondary">Doe & Co · Aug 12</span></th><td class="d-none d-md-table-cell">Doe & Co</td><td class="d-none d-md-table-cell">Aug 12</td><td class="text-end small text-body-secondary">Best in print</td></tr>
                <tr><th scope="row"><span class="d-block">Landing page kit</span><span class="d-md-none small fw-normal text-body-secondary">Moe Labs · Sep 03</span></th><td class="d-none d-md-table-cell">Moe Labs</td><td class="d-none d-md-table-cell">Sep 03</td><td class="text-end small text-body-secondary">Site of the day</td></tr>
                <tr><th scope="row"><span class="d-block">Packaging system</span><span class="d-md-none small fw-normal text-body-secondary">Dooley Foods · Sep 29</span></th><td class="d-none d-md-table-cell">Dooley Foods</td><td class="d-none d-md-table-cell">Sep 29</td><td class="text-end small text-body-secondary">—</td></tr>
              </tbody>
            </table>
          </div>
        </div>
      </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.