ID

Data tables

DataTables with the Selaras skin — sorting, search, paging and filters, in every theme and mode.

DataTables 2.3.8 · MIT · needs jQuery 3.7.1 Docs

From JavaScript data

Rows come from the same invoice data as the Invoices app. Status sorts by meaning (draft → pending → overdue → paid), the filter uses the DataTables search API, and the footer totals whatever is currently filtered.

Invoices

Every invoice, newest first

Invoice Client Project Issued Due Amount Status
Total (all invoices) —
JavaScript
// 1. load jQuery, dataTables.min.js and dataTables.bootstrap5.min.js (+ its CSS before selaras.css)
// 2. give the table the Selaras class and wrap it in .sl-dt
const table = new DataTable('#dtInvoices', {
  data: rows,                                  // an array of objects
  columns: [
    { data: 'no', render: (no) => `<a href="app-invoice.html?no=${no}">${no}</a>` },
    { data: 'client' },
    { data: 'amount', className: 'num', render: DataTable.render.number(',', '.', 2, '$') }
  ],
  order: [[0, 'desc']],
  pageLength: 8,
  lengthMenu: [5, 8, 14],
  language: { search: '', searchPlaceholder: 'Search invoices…' }
});
// filter a column from your own control
status.addEventListener('change', () => table.draw());

Zero configuration

Any .sl-table already in your HTML becomes a data table with one line: new DataTable('#dtTeam', { pageLength: 5 }).

NameRoleCompanyStatus
SHSendy Hartantosendy@selaras.appDelivery managerSelaras StudioOnline
CMClara Mendesclara@selaras.appProduct designerSelaras StudioOnline
AWAditya Wibowoaditya@selaras.appFrontend engineerSelaras StudioOnline
FRFarhan Rizkifarhan@selaras.appBackend engineerSelaras StudioAway
HSHendra Saputrahendra@selaras.appProject leadSelaras StudioOnline
GLGrace Liugrace@selaras.appQA engineerSelaras StudioOffline
MLMarcus Leemarcus@pinecresthr.comHR directorPinecrest HROnline
ATAva Thompsonava@harborcoffee.comMarketing leadHarbor CoffeeOffline
DRDiego Ramosdiego@lumenfitness.comProduct ownerLumen FitnessOffline