Skip to the page content

Basic tables

Ten Bootstrap tables filled with Fieldline's accounts, invoices, crews and Marlo orders, sorting, searching and editing in plain JavaScript.

10 tables

Marlo clothing in stock

The plain Bootstrap table. Switch its modifier classes on and off to see each one; the class list underneath is what goes in your markup.

Table classes

class="table table-striped table-hover"

Marlo clothing in stock
Item Category SKU In stock Price
Sculpted Shoulder Blazer Clothing ML-BLAZ 38 $1,290.00
Draped Column Gown Clothing ML-GOWN 54 $2,150.00
Tiered Organza Dress Clothing ML-ORGZ 120 $1,680.00
Chalk-Stripe Suit Clothing ML-SUIT 16 $2,450.00
Leather Trench Coat Clothing ML-TRCH 0 $3,200.00
Cat-Eye Sunglasses Accessories ML-CATE 23 $465.00
Show code
<table class="table table-striped table-hover align-middle">
  <thead>
    <tr><th scope="col">Item</th><th scope="col" class="text-end">Price</th></tr>
  </thead>
  <tbody>
    <tr><th scope="row">Sculpted Shoulder Blazer</th><td class="text-end">$1,290.00</td></tr>
  </tbody>
</table>

Today's Marlo orders

Every header is a button. Click once to sort up, again to sort down; the arrow shows which way.

Sortable
Today's Marlo orders. Column headers sort the table.
#18342 Annabelle Franklin 9:42 am Paid $1,298.00
#18341 Cheryl Sorensen 9:31 am Packing $930.00
#18340 Travis Daugherty 9:05 am Paid $2,596.00
#18339 Christopher Vance 8:58 am Refunded $3,216.00
#18338 Iva Blackwood 8:40 am Shipped $2,566.00
#18337 Sabrina Kavanagh 8:22 am Paid $4,316.00
#18336 Phyllis Delaney 8:03 am Shipped $3,570.00
#18335 Georgia Webster 7:47 am Packing $3,300.00

Show code
<th scope="col" aria-sort="none">
  <button type="button" class="tb-sort" data-tb-sort="num">
    Total <i class="bi bi-chevron-expand" aria-hidden="true"></i>
  </button>
</th>
<!-- data-sort="1298.00" on a cell sorts by that value instead of its text -->

Subscription invoices

Rows take a soft wash of the status color, so the overdue ones stand out. The badge says the same thing in words.

Row tones
Subscription invoices by due date
Invoice Account Due Status Amount
#30412 Northgate Analytics Aug 12 Overdue $1,280.00
#30455 Ironbridge Fintech Aug 19 Overdue $270.00
#30518 Highpoint Photo Studios Sep 30 Due soon $2,436.00
#30527 Polaris Running Co. Group Oct 2 Due soon $576.00
#30561 Cornerstone Logistics Oct 14 Open $960.00
#30388 Brightline Photography Sep 5 Paid $3,480.00
Show code
<tr class="tb-row-danger">
  <th scope="row">#30412</th>
  <td><span class="badge tb-tone tb-tone-danger">Overdue</span></td>
</tr>
<!-- also tb-row-warning and tb-row-success -->

Supplies in the cars

Type to filter as you go; it matches the item, item no. and supplier. The industry menu narrows it further, and the count underneath keeps up.

Search

10 supplies

Supplies in the cars. Use the search box and industry menu to narrow the list.
Item Item no. Supplier Industry Unit cost In cars
Nitrile gloves, size M GLV-100 Carewell Supply Home care $18.50 48
Hand sanitizer, 500 ml SAN-500 Carewell Supply Home care $24.00 22
Slip lead, 1.5 m SL-150 Pawsworth Pet Supplies Pet care $12.75 64
Treat pouch, small TP-100 Pawsworth Pet Supplies Pet care $9.50 18
SD card, 128 GB SD-128 Glint Camera Co. Photography $21.00 90
Pulse oximeter #115 Carewell Supply Home care $68.00 Low12
Lens wipes, pack of fifty LW-120 Glint Camera Co. Photography $8.25 40
Carpet shampoo, 5 liter CSH-500 Brightway Clean Cleaning $96.00 Low9
Dog shampoo sachet DS-01 Pawsworth Pet Supplies Pet care $4.50 55
Mop heads, pack of six MH-36 Brightway Clean Cleaning $42.00 30
Show code
<input type="search" class="form-control"
       aria-label="Search supplies" aria-controls="tb-parts" data-tb-search>
<p aria-live="polite" data-tb-search-count>10 supplies</p>

<table class="table table-striped" id="tb-parts">...</table>

Maintenance plans due

Check rows, or the box in the header for all of them, then pause or resume the lot. A half-checked header means some are chosen.

Row selection

None selected

Maintenance plans with a visit due. Check rows to pause or resume them together.
Customer Plan Next visit Status
Ruth Osgood Garden tidy-up, monthly Oct 3 Active
Travis Hale Lawn and hedge care, twice a year Oct 3 Active
Delia Franklin Gutter clear-out Oct 5 Paused
Tom Zimmerman Lawn and hedge care, twice a year Oct 6 Active
Alicia Sexton Window cleaning, quarterly Oct 8 Active
Greg Lawson Garden tidy-up, monthly Oct 9 Paused
Show code
<tr class="table-active">  <!-- added while the row is checked -->
  <td><input class="form-check-input" type="checkbox"
             aria-label="Select Ruth Osgood" data-tb-select-row></td>
  <th scope="row">Ruth Osgood</th>
</tr>

Service price list

Edit turns the two prices in that row into inputs. A price has to be a number above zero before it saves.

Inline edit
Service price list. Edit changes a row in place.
Service Industry Standard After hours Actions
Care assessment Home care $89.00 $139.00
Home care visit Home care $134.00 $179.00
Dog walk, 1 hour Pet care $145.00 $210.00
Overnight pet stay Pet care $99.00 $155.00
Headshot session Photography $115.00 $172.00
Mini photo session Photography $75.00 $120.00

Enter saves, Escape cancels.

Show code
<td class="text-end" data-tb-edit="standard price">$89.00</td>
...
<button type="button" class="btn btn-outline-secondary btn-sm"
        data-tb-edit-start aria-label="Edit Care assessment prices">Edit</button>

Accounts

Twenty-four accounts, six to a page. Sorting reorders the whole list and takes you back to page one.

Paging
Accounts, six to a page. Column headers sort the whole list.
Billing
Bluepeak Studiosbilling@bluepeakstudios.example Boulder 22 $704.00 Sep 26 Annual
Brightline Photographybilling@brightlinephoto.example Columbus 60 $3,480.00 Sep 25 Monthly
Copperleaf Designbilling@copperleafdesign.example Eugene 14 $210.00 Sep 21 Monthly
Cornerstone Logisticsbilling@cornerstonelogistics.example Nashville 30 $960.00 Sep 24 Monthly
Evergreen Landscapingbilling@evergreenlandscaping.example Raleigh 9 $135.00 Sep 9 Monthly
Granite Fell Gearbilling@graniteridgegear.example Salt Lake City 12 $384.00 Sep 18 Annual
Harborline AIbilling@harborlineai.example Tampa 26 $832.00 Sep 22 Annual
Ironbridge Fintechbilling@ironbridgefintech.example Pittsburgh 18 $270.00 Aug 30 Monthly
Avocet Roboticsbilling@avocetrobotics.example Waco 34 $1,088.00 Sep 23 Annual
Lakeside Apparelbilling@lakesideapparel.example Madison 11 $172.00 Sep 14 Monthly
Oakhaven Studiobilling@oakhavenstudio.example Phoenix 85 $4,930.00 Sep 26 Annual
Northgate Analyticsbilling@northgateanalytics.example Minneapolis 40 $1,280.00 Sep 20 Monthly
Oakline Interiorsbilling@oaklineproperty.example Boise 6 $90.00 Jul 14 Monthly
Larchwood Studiosbilling@larchwoodstudios.example Huntsville 28 $896.00 Sep 19 Annual
Polaris Running Co. Groupbilling@polarisrunningco.example Concord 18 $576.00 Sep 11 Monthly
Redwood Soundbilling@redwoodpools.example Sacramento 8 $120.00 Aug 4 Monthly
Millrace Ceramicsbilling@riverbendceramics.example Omaha 5 $75.00 Jun 28 Monthly
Sterling Watch Co. Groupbilling@sterlinglabs.example Stamford 46 $2,668.00 Sep 24 Annual
Highpoint Outfittersbilling@highpointoutfitters.example Tacoma 52 $3,016.00 Sep 26 Annual
Highpoint Photo Studiosbilling@summitphoto.example Houston 42 $2,436.00 Sep 25 Monthly
Tidewater Labs Groupbilling@tidewaterlabs.example Norfolk 7 $105.00 Aug 21 Monthly
Valley Printsbilling@valleywindows.example Fresno 10 $320.00 Aug 15 Monthly
Westfield Dog Walkersbilling@westfielddogs.example Spokane 4 $64.00 Jul 30 Monthly
Yellowstone Photographybilling@yellowstonephoto.example Billings 13 $416.00 Sep 2 Annual

1–6 of 24 accounts

Show code
<table class="table table-hover" data-tb-sortable data-tb-paged="6" id="tb-customers">...</table>

<nav aria-label="Account pages">
  <ul class="pagination pagination-sm mb-0" data-tb-pages></ul>
</nav>

Shop order

A caption on top, a head, and a footer that adds the lines up again every time a quantity changes.

Header and footer
Order #18346 for Sabrina Kavanagh
Item Qty Each Line
Two-Tone Oxfords
$850.00 $3,400.00
Shield Sunglasses
$520.00 $3,120.00
Bar Loafers
$790.00 $1,580.00
E-Gift Card, $250
$250.00 $750.00
Subtotal $0.00
Delivery $0.00
Total $0.00

Delivery is free over $500.

Show code
<table class="table caption-top">
  <caption>Order #18346 for Sabrina Kavanagh</caption>
  <thead>...</thead>
  <tbody>
    <tr>
      <th scope="row">Two-Tone Oxfords</th>
      <td class="text-end">
        <div class="basalt-stepper basalt-stepper-sm" data-basalt-stepper>
          <button type="button" class="basalt-stepper-btn" data-basalt-step="-1" aria-label="One fewer"><i class="bi bi-dash-lg" aria-hidden="true"></i></button>
          <input type="number" class="basalt-stepper-input" min="0" max="99" value="4" inputmode="numeric" aria-label="Quantity of Two-Tone Oxfords">
          <button type="button" class="basalt-stepper-btn" data-basalt-step="1" aria-label="One more"><i class="bi bi-plus-lg" aria-hidden="true"></i></button>
        </div>
      </td>
      <td class="text-end">$52.00</td>
      <td class="text-end">$208.00</td>
    </tr>
    ...
  </tbody>
  <tfoot>
    <tr><th scope="row" colspan="3">Total</th><td class="text-end">$645.00</td></tr>
  </tfoot>
</table>

Waiting to ship

The arrow opens a small table of what goes in the box, right under its order.

Expandable rows
Orders waiting to ship. The arrow on each row shows what is in the box.
Details Order Customer Items Total
#18341 Cheryl Sorensen 1 item $930.00
Items in order #18341
Item Qty Line
Cat-Eye Sunglasses 2 $930.00
#18335 Georgia Webster 2 items $3,300.00
#18333 Benjamin Hartley 4 items $8,770.00
#18331 Natalie Tanner 2 items $8,850.00
Show code
<tr>
  <td><button type="button" aria-expanded="false" aria-controls="tb-ship-1"
              data-tb-expand>...</button></td>
  <th scope="row">#18341</th>
</tr>
<tr id="tb-ship-1" hidden>
  <td colspan="5"><table class="table table-sm">...</table></td>
</tr>

Crews on today's board

One tbody per crew, each with its own heading row that folds the group away. The column heads stay pinned under the top bar while the page scrolls.

Grouped rows
Staff on today's board, grouped by crew. Each group heading folds its rows away.
Team member Role Car Visits today Capacity Load
Dana Rudd Carer Car 12 4 6 Open
Kirk Mathis Carer Car 07 6 6 Full
Dawn Harrell Senior carer Car 15 3 5 Open
Pete Quigley Nurse Car 03 5 5 Full
Robyn Daniels Nurse Car 09 4 6 Open
Rory Whitfield Carer Car 11 5 6 Open
Jay Roe Senior carer Car 18 7 5 Overbooked
Hailey Kirkland Carer Car 04 2 6 Open
Gerald Brady Nurse Car 14 5 6 Open
Sandra Hanson Senior carer Car 21 4 5 Open
Ty Robinson Carer Car 02 3 4 Open
Brenda Gill Nurse Car 06 6 4 Overbooked
Show code
<div class="table-responsive tb-scroll" tabindex="0">   <!-- no max-height: page scrolls -->
  <table class="table tb-sticky">                      <!-- thead th is position: sticky -->
    <tbody>
      <tr class="tb-group"><th scope="rowgroup" colspan="6">North crew</th></tr>
      <tr><th scope="row">Dana Rudd</th>...</tr>
    </tbody>
  </table>
</div>