Smart Table Examples

Premium data tables with sorting, filtering, pagination, and export capabilities

Basic Smart Table

The simplest implementation - just add data-rsl-smart-table to any table. Instantly get search, pagination, and a polished UI.

Search Export Column Toggle Pagination
# Name Email Role Status
1John Smithjohn@example.comDeveloperActive
2Sarah Johnsonsarah@example.comDesignerActive
3Mike Wilsonmike@example.comManagerPending
4Emily Brownemily@example.comDeveloperActive
5David Leedavid@example.comDesignerInactive
6Lisa Chenlisa@example.comDeveloperActive
7James Taylorjames@example.comManagerActive
8Anna Martinezanna@example.comDesignerPending
Basic Smart Table • HTML
# Name Email Role Status
1 John Smith john@example.com Developer Active

Column Filters

Add per-column filtering with text inputs or dropdown selectors. Use data-filterable for text filters or data-filter="select" for dropdowns.

Text Filters Select Filters Multi-column Sort
Order # Customer Product Status Total Date
1001Alice JohnsonLaptop Pro 15Delivered$1,299.00Nov 28, 2024
1002Bob WilliamsWireless MouseShipped$49.99Nov 27, 2024
1003Carol DavisUSB-C HubProcessing$89.99Nov 26, 2024
1004David MillerMechanical KeyboardDelivered$159.99Nov 25, 2024
1005Emma WilsonMonitor 27"Cancelled$449.99Nov 24, 2024
1006Frank BrownWebcam HDShipped$79.99Nov 23, 2024
1007Grace LeeLaptop Pro 15Delivered$1,299.00Nov 22, 2024
1008Henry TaylorHeadphones ProProcessing$249.99Nov 21, 2024
Column Filters • HTML
Order # Customer Product Status Total Date
$1,299.00 Nov 28, 2024

Row Selection

Enable row selection for bulk operations with data-selectable. Selection state is tracked and accessible via JavaScript API.

Select All Click Selection Selection Bar
Employee Department Location Salary
Jennifer AdamsEngineeringNew York$125,000
Michael ChenMarketingSan Francisco$95,000
Sarah ThompsonDesignChicago$88,000
Robert GarciaEngineeringAustin$115,000
Lisa WangHRSeattle$78,000
David KimEngineeringBoston$135,000
Selection API • JavaScript
// Get instance
const table = document.querySelector('#selectable-table');
const instance = RSL.SmartTable.getInstance(table);

// Get selected rows
const selected = instance.getSelectedRows();
console.log(selected);

// Select specific row
instance.selectRow('emp-1');

// Select all
instance.selectAll();

// Clear selection
instance.clearSelection();

// Listen for selection changes
table.addEventListener('rsl-smart-table:selection', (e) => {
    console.log('Selected:', e.detail.selected);
});

Sticky Header

Keep headers visible while scrolling through large datasets. Add data-sticky-header to enable. This example has 35 rows - try changing the page size to see pagination in action.

ID Product Name Category Stock Price
1Wireless Earbuds ProElectronics245$129.99
2Smart Watch Series 5Electronics89$299.99
3Organic Green TeaFood & Beverage512$24.99
4Yoga Mat PremiumSports178$49.99
5LED Desk LampHome324$39.99
6Bluetooth SpeakerElectronics156$79.99
7Cotton T-ShirtClothing892$19.99
8Stainless Steel BottleHome445$29.99
9Running ShoesSports267$89.99
10Protein PowderFood & Beverage198$44.99
11Wireless ChargerElectronics312$34.99
12Bamboo Cutting BoardHome523$27.99
13Denim JacketClothing134$69.99
14Resistance Bands SetSports445$22.99
15Herbal Tea CollectionFood & Beverage289$18.99
16Laptop StandElectronics178$45.99
17Wool SweaterClothing234$79.99
18Air FryerHome89$129.99
19Tennis RacketSports156$149.99
20Coffee Beans PremiumFood & Beverage678$32.99
21USB-C HubElectronics423$59.99
22Linen ShirtClothing312$54.99
23Vacuum CleanerHome67$249.99
24BasketballSports534$29.99
25Olive Oil Extra VirginFood & Beverage892$19.99
26Mechanical KeyboardElectronics145$119.99
27Winter CoatClothing89$189.99
28Blender ProHome234$89.99
29Dumbbells SetSports178$99.99
30Almond ButterFood & Beverage445$14.99
31Webcam HDElectronics267$69.99
32Silk ScarfClothing156$39.99
33Toaster OvenHome198$79.99
34Jump RopeSports789$12.99
35Honey Raw OrganicFood & Beverage356$22.99
Sticky Header (35 rows) • HTML
ID Product

Data Export

Export table data to CSV, JSON, or Excel format. Use data-exportable and optionally data-export-formats="csv,json,excel" to customize.

CSV Export JSON Export Excel Export Export Filtered
Country Capital Population GDP (Billion) Continent
United StatesWashington D.C.331M$21,433BNorth America
ChinaBeijing1.44B$14,343BAsia
JapanTokyo126M$5,082BAsia
GermanyBerlin84M$3,846BEurope
United KingdomLondon68M$2,827BEurope
IndiaNew Delhi1.38B$2,875BAsia
FranceParis65M$2,716BEurope
BrazilBrasília213M$1,839BSouth America
Export API • JavaScript
const table = document.querySelector('#export-table');
const instance = RSL.SmartTable.getInstance(table);

// Export to CSV (all data)
instance.export('csv', 'all');

// Export to JSON (filtered data only)
instance.export('json', 'filtered');

// Export to Excel
instance.export('excel', 'all');

// Custom export handler
instance.onExport = (data) => {
    // Custom handling - e.g., send to server
    console.log(data.format, data.data);
};

JavaScript API

Full programmatic control over sorting, filtering, pagination, and more.

Task Priority Assignee Due Date
Implement login featureHighJohnDec 5, 2024
Fix navigation bugMediumSarahDec 8, 2024
Update documentationLowMikeDec 15, 2024
Database optimizationHighEmilyDec 3, 2024
Add unit testsMediumDavidDec 10, 2024
UI/UX improvementsLowLisaDec 20, 2024
API integrationHighJamesDec 4, 2024
Security auditHighAnnaDec 2, 2024
Full API Reference • JavaScript
// Initialize all Smart Tables
RSL.SmartTable.init();

// Get instance for specific table
const table = document.querySelector('#my-table');
const instance = RSL.SmartTable.getInstance(table);

// Sorting
instance.sort('dueDate', 'asc');    // Sort ascending
instance.sort('priority', 'desc'); // Sort descending
instance.clearSort();               // Clear all sorting

// Filtering
instance.filterColumn('priority', 'High');  // Filter column
instance.search('John');                     // Global search
instance.clearFilters();                     // Clear all filters

// Pagination
instance.goToPage(2);           // Go to page 2
instance.nextPage();            // Next page
instance.prevPage();            // Previous page
instance.setPageSize(25);       // Change page size

// Selection (if enabled)
instance.selectRow('row-id');   // Select row
instance.deselectRow('row-id'); // Deselect row
instance.selectAll();           // Select all
instance.clearSelection();      // Clear selection
instance.getSelectedRows();     // Get selected data

// Export
instance.export('csv', 'all');       // All data
instance.export('json', 'filtered'); // Filtered only

// State
const state = instance.getState();
console.log(state);
// { sort: [...], filters: {...}, page: 1, pageSize: 10, ... }

// Refresh
instance.refresh();

// Destroy
instance.destroy();

Row Actions Menu

Add per-row action buttons for View, Edit, Delete, and custom actions. Use data-row-actions to enable. Customize actions with data-row-action-items="view,edit,delete".

View Edit Delete Custom Actions
ID Project Client Status Budget
101Website RedesignAcme CorpActive$25,000
102Mobile AppTechStartOn Hold$45,000
103E-commerce PlatformShopMaxActive$75,000
104Dashboard AnalyticsDataViz IncPlanning$35,000
105CRM IntegrationSalesForceCancelled$50,000
106API DevelopmentCloudNineActive$30,000
Row Actions • HTML

Quick Filter Chips

Pre-defined filter buttons for common filtering needs. Define filters via JavaScript configuration for instant one-click filtering.

One-Click Filter Color Coded Custom Functions
Quick Filters • JavaScript
// Create table with quick filters
const table = document.querySelector('#my-table');
RSL.SmartTable.create(table, {
    quickFilters: [
        {
            label: 'Active',
            icon: 'fas fa-check',
            column: 'status',
            value: 'Active',
            color: '#10b981'
        },
        {
            label: 'Pending',
            icon: 'fas fa-clock',
            column: 'status',
            value: 'Pending',
            color: '#f59e0b'
        },
        {
            label: 'High Priority',
            icon: 'fas fa-exclamation',
            // Custom filter function
            filter: (row) => row.priority?.value === 'High'
        }
    ]
});

Copy to Clipboard

Quickly copy table data to clipboard in tab-separated format (paste-friendly for Excel). Add data-copyable to enable.

One-Click Copy Excel Compatible Toast Feedback
Product SKU Quantity Price
Laptop Pro 15"LP-00145$1,299
Wireless MouseWM-202230$49
USB-C HubUC-30389$79
Mechanical KeyboardMK-404156$159
Monitor 27"MN-50567$449
Webcam HDWC-606312$89
Copy to Clipboard • HTML + JavaScript


    ...

Conditional Formatting

Apply styles, badges, icons, or progress bars based on cell values. Configure rules per column to highlight important data.

Badges Progress Bars Icons Heat Maps
Conditional Formatting • JavaScript
RSL.SmartTable.create(table, {
    conditionalFormatting: [
        {
            column: 'status',
            rules: [
                {
                    condition: 'equals',
                    value: 'Complete',
                    badge: 'success'  // Green badge
                },
                {
                    condition: 'equals',
                    value: 'In Progress',
                    badge: 'warning'  // Yellow badge
                },
                {
                    condition: 'equals',
                    value: 'Blocked',
                    badge: 'error',   // Red badge
                    icon: 'fa-exclamation-triangle',
                    iconColor: '#ef4444'
                }
            ]
        },
        {
            column: 'progress',
            rules: [
                {
                    condition: 'not_empty',
                    progressBar: true,
                    progressColor: '#6E7BFF'
                }
            ]
        },
        {
            column: 'score',
            rules: [
                { condition: 'greater_than', value: 90, class: 'rsl-heat-low' },
                { condition: 'between', min: 70, max: 90, class: 'rsl-heat-medium' },
                { condition: 'less_than', value: 70, class: 'rsl-heat-high' }
            ]
        }
    ]
});

Inline Editing

Double-click any cell to edit it in place. Press Enter to save, Escape to cancel. The table dispatches events with the complete table data as JSON for easy saving to your backend.

Double-Click Edit Enter to Save JSON Export Page Builder Ready
Product Name Category Price Stock
Wireless HeadphonesElectronics8945
Running ShoesSports12978
Coffee MakerHome6923
Yoga MatSports35120
Desk LampHome4567
Inline Editing + JSON API • JavaScript
// Enable inline editing
<table data-rsl-smart-table data-inline-editing>

// Listen for cell edits
table.addEventListener('rsl-smart-table:cell-edit', (e) => {
    const { column, oldValue, newValue, tableData } = e.detail;

    // tableData contains complete JSON for saving
    console.log('Updated table:', tableData);

    // Send to your backend
    fetch('/api/save-table', {
        method: 'POST',
        body: JSON.stringify(tableData)
    });
});

// Get all table data as JSON
const instance = RSL.SmartTable.getInstance(table);
const data = instance.getTableData();
// { columns: [...], rows: [...], config: {...}, state: {...} }

// Load data into table (for page builder)
instance.loadData({
    rows: [
        { _id: 'row-1', name: 'Product A', price: 99 },
        { _id: 'row-2', name: 'Product B', price: 149 }
    ]
});

Summary/Totals Row

Automatically calculate and display aggregations at the bottom of the table. Supports sum, average, count, min, and max for numeric columns.

Sum Average Count Min/Max
Summary Row • JavaScript
// Enable via data attribute
<table data-rsl-smart-table data-summary-row>

// Or configure specific columns
RSL.SmartTable.create(table, {
    summaryRow: true,
    summaryColumns: [
        { column: 'quantity', type: 'sum', label: 'Total' },
        { column: 'price', type: 'avg', label: 'Avg' },
        { column: 'orders', type: 'count', label: 'Count' },
        { column: 'rating', type: 'max', label: 'Best' }
    ]
});

// Summary types: 'sum', 'avg', 'count', 'min', 'max'

Row Expansion

Click to expand rows and show additional details in a panel. Perfect for master-detail views, nested data, or showing more information without cluttering the table.

Expand/Collapse Detail Panel Custom Templates
Order # Customer Date Total Status
ORD-2024-001Alice JohnsonNov 28, 2024$249.99Delivered
ORD-2024-002Bob SmithNov 27, 2024$89.50Shipped
ORD-2024-003Carol DavisNov 26, 2024$567.00Processing
ORD-2024-004David MillerNov 25, 2024$1,250.00Delivered
ORD-2024-005Eva WilsonNov 24, 2024$45.00Cancelled
Row Expansion • JavaScript
// Enable via data attribute
<table data-rsl-smart-table data-expandable-rows>

// Or with custom template
RSL.SmartTable.create(table, {
    expandableRows: true,
    expandTemplate: (rowData) => `
        <div class="order-details">
            <h4>Order Items</h4>
            <ul>
                <li>Product A - $99.99</li>
                <li>Product B - $49.99</li>
            </ul>
            <p>Shipping: ${rowData.customer?.value}</p>
        </div>
    `
});

// Listen for expand/collapse events
table.addEventListener('rsl-smart-table:row-expand', (e) => {
    const { row, panel } = e.detail;
    // Load additional data into panel
});

table.addEventListener('rsl-smart-table:row-collapse', (e) => {
    console.log('Row collapsed:', e.detail.row);
});

Column Resizing

Drag column borders to resize. Minimum width is configurable (default 100px). Use keyboard arrows for fine-tuning.

Drag to Resize Keyboard Support Min Width
ID Product Name Description Price Category
PRD-001Wireless KeyboardErgonomic design with backlit keys$79.99Electronics
PRD-002USB-C Hub7-in-1 multiport adapter$49.99Accessories
PRD-003Monitor StandAdjustable height aluminum stand$129.00Furniture
Column Resizing • HTML
<table data-rsl-smart-table
       data-column-resizing
       data-min-column-width="100">

// Get/set column widths programmatically
const widths = instance.getColumnWidths();
instance.setColumnWidths({ name: 200, description: 350 });

// Listen for resize events
table.addEventListener('rsl-smart-table:column-resize', (e) => {
    console.log('Column', e.detail.column, 'resized to', e.detail.width);
});

Column Reordering

Drag and drop column headers to rearrange columns. Column order is preserved in saved views.

Drag & Drop Auto-Update Saveable
Date Event Location Attendees Status
Dec 15, 2024Annual ConferenceNew York500Confirmed
Dec 20, 2024Product LaunchSan Francisco200Planning
Jan 10, 2025Training WorkshopChicago75Open
Column Reordering • JavaScript
// Enable column reordering
<table data-rsl-smart-table data-column-reordering>

// Get/set column order programmatically
const order = instance.getColumnOrder(); // ['date', 'event', 'location', ...]
instance.setColumnOrder(['event', 'date', 'status', 'location', 'attendees']);

// Listen for reorder events
table.addEventListener('rsl-smart-table:column-reorder', (e) => {
    console.log('Moved from', e.detail.fromIndex, 'to', e.detail.toIndex);
    console.log('New order:', e.detail.columnOrder);
});

Frozen/Pinned Columns

Pin columns to the left or right edge. They stay visible while scrolling horizontally. Great for ID or action columns.

Pin Left Pin Right JS API
ID First Name Last Name Email Department Job Title Phone Actions
EMP-001JohnSmithjohn.smith@example.comEngineeringSenior Developer(555) 123-4567
EMP-002SarahJohnsonsarah.j@example.comMarketingMarketing Manager(555) 234-5678
EMP-003MichaelBrownm.brown@example.comSalesSales Representative(555) 345-6789
Frozen Columns • JavaScript
// Via data attribute (JSON format)
<table data-rsl-smart-table
       data-frozen-columns='{"left":["id"],"right":["actions"]}'>

// Via JavaScript
RSL.SmartTable.create(table, {
    frozenColumns: {
        left: ['id', 'name'],    // Pin these to left
        right: ['actions']        // Pin these to right
    }
});

// Pin/unpin dynamically
instance.pinColumn('status', 'left');
instance.pinColumn('total', 'right');
instance.unpinColumn('status');

Bulk Actions Bar

When rows are selected, a floating action bar appears with batch operations. Fully configurable actions including status changes.

Bulk Delete Export Selected Change Status
Ticket # Subject Priority Status Assignee
TKT-001Login page not loadingHighActiveAlice
TKT-002Password reset brokenCriticalActiveBob
TKT-003Feature request: Dark modeLowPendingCarol
TKT-004Export fails for large datasetsMediumActiveDavid
TKT-005Mobile layout issuesMediumInactiveEve
Bulk Actions • HTML
<table data-rsl-smart-table
       data-selectable
       data-bulk-actions
       data-bulk-action-items="delete,export,status"
       data-bulk-status-options="Active,Inactive,Pending,Archived">

// Listen for bulk action events
table.addEventListener('rsl-smart-table:bulk-delete', (e) => {
    console.log('Deleting', e.detail.count, 'rows');
});

table.addEventListener('rsl-smart-table:bulk-status-change', (e) => {
    console.log('Changing status to:', e.detail.newStatus);
    // Update your backend here
});

Saved Views

Save and load view configurations including sort, filters, column visibility, widths, and order. Perfect for dashboards where users need different data perspectives.

Save Views Load Views localStorage
Project Manager Budget Progress % Deadline Status
Website RedesignAlice$50,00075Jan 15, 2025On Track
Mobile App v2Bob$120,00040Mar 1, 2025At Risk
API IntegrationCarol$30,00090Dec 20, 2024Completed
Database MigrationDavid$75,00020Feb 28, 2025Delayed
Saved Views API • JavaScript
// Enable saved views
<table data-rsl-smart-table data-saved-views>

// Save current view
instance.saveView('My Custom View');

// Load a saved view
instance.loadView('My Custom View');

// Get all saved views (for server sync)
const views = instance.getSavedViews();
// Send to server: fetch('/api/views', { method: 'POST', body: JSON.stringify(views) });

// Delete a view
instance.deleteView('Old View');

// Reset to defaults
instance.resetView();

// Events
table.addEventListener('rsl-smart-table:view-saved', (e) => {
    console.log('Saved view:', e.detail.name);
});

Full Page Mode

Expand the table to fill the entire viewport for data-intensive work. Press Escape or click the button again to exit.

Fullscreen Esc to Exit Configurable
SKU Product Warehouse Qty Reorder Point Status
SKU-A001Widget ProWarehouse A25050In Stock
SKU-A002Gadget PlusWarehouse A45100Low Stock
SKU-B001Component XWarehouse B1200200In Stock
SKU-B002Assembly KitWarehouse B025Out of Stock
SKU-C001Premium BundleWarehouse C8930In Stock

Click the expand icon () in the toolbar to enter full-page mode.

Full Page Mode • JavaScript
// Enable full page mode button
<table data-rsl-smart-table
       data-full-page-mode
       data-full-page-padding="20">

// Toggle programmatically
instance.toggleFullPage();

// Check current state
if (instance.isFullPage()) {
    console.log('Currently in full page mode');
}

// Listen for toggle
table.addEventListener('rsl-smart-table:fullpage-toggle', (e) => {
    console.log('Full page mode:', e.detail.isFullPage);
});

Next Steps

API Reference

View complete API documentation

Try Playground

Test features in playground.html

More Components

Browse all RSL components

See FilterBus in Action

Watch how Smart Table filters rows based on FilterBus state. This live demo shows Filter + Smart Table + KPI Cards + Charts all working together.

View Live Dashboard Demo