Premium data tables with sorting, filtering, pagination, and export capabilities
The simplest implementation - just add data-rsl-smart-table to any table. Instantly get search, pagination, and a polished UI.
| # | Name | Role | Status | |
|---|---|---|---|---|
| 1 | John Smith | john@example.com | Developer | Active |
| 2 | Sarah Johnson | sarah@example.com | Designer | Active |
| 3 | Mike Wilson | mike@example.com | Manager | Pending |
| 4 | Emily Brown | emily@example.com | Developer | Active |
| 5 | David Lee | david@example.com | Designer | Inactive |
| 6 | Lisa Chen | lisa@example.com | Developer | Active |
| 7 | James Taylor | james@example.com | Manager | Active |
| 8 | Anna Martinez | anna@example.com | Designer | Pending |
#
Name
Email
Role
Status
1
John Smith
john@example.com
Developer
Active
Add per-column filtering with text inputs or dropdown selectors. Use data-filterable for text filters or data-filter="select" for dropdowns.
| Order # | Customer | Product | Status | Total | Date |
|---|---|---|---|---|---|
| 1001 | Alice Johnson | Laptop Pro 15 | Delivered | $1,299.00 | Nov 28, 2024 |
| 1002 | Bob Williams | Wireless Mouse | Shipped | $49.99 | Nov 27, 2024 |
| 1003 | Carol Davis | USB-C Hub | Processing | $89.99 | Nov 26, 2024 |
| 1004 | David Miller | Mechanical Keyboard | Delivered | $159.99 | Nov 25, 2024 |
| 1005 | Emma Wilson | Monitor 27" | Cancelled | $449.99 | Nov 24, 2024 |
| 1006 | Frank Brown | Webcam HD | Shipped | $79.99 | Nov 23, 2024 |
| 1007 | Grace Lee | Laptop Pro 15 | Delivered | $1,299.00 | Nov 22, 2024 |
| 1008 | Henry Taylor | Headphones Pro | Processing | $249.99 | Nov 21, 2024 |
Order #
Customer
Product
Status
Total
Date
$1,299.00
Nov 28, 2024
Enable row selection for bulk operations with data-selectable. Selection state is tracked and accessible via JavaScript API.
| Employee | Department | Location | Salary |
|---|---|---|---|
| Jennifer Adams | Engineering | New York | $125,000 |
| Michael Chen | Marketing | San Francisco | $95,000 |
| Sarah Thompson | Design | Chicago | $88,000 |
| Robert Garcia | Engineering | Austin | $115,000 |
| Lisa Wang | HR | Seattle | $78,000 |
| David Kim | Engineering | Boston | $135,000 |
// 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);
});
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 |
|---|---|---|---|---|
| 1 | Wireless Earbuds Pro | Electronics | 245 | $129.99 |
| 2 | Smart Watch Series 5 | Electronics | 89 | $299.99 |
| 3 | Organic Green Tea | Food & Beverage | 512 | $24.99 |
| 4 | Yoga Mat Premium | Sports | 178 | $49.99 |
| 5 | LED Desk Lamp | Home | 324 | $39.99 |
| 6 | Bluetooth Speaker | Electronics | 156 | $79.99 |
| 7 | Cotton T-Shirt | Clothing | 892 | $19.99 |
| 8 | Stainless Steel Bottle | Home | 445 | $29.99 |
| 9 | Running Shoes | Sports | 267 | $89.99 |
| 10 | Protein Powder | Food & Beverage | 198 | $44.99 |
| 11 | Wireless Charger | Electronics | 312 | $34.99 |
| 12 | Bamboo Cutting Board | Home | 523 | $27.99 |
| 13 | Denim Jacket | Clothing | 134 | $69.99 |
| 14 | Resistance Bands Set | Sports | 445 | $22.99 |
| 15 | Herbal Tea Collection | Food & Beverage | 289 | $18.99 |
| 16 | Laptop Stand | Electronics | 178 | $45.99 |
| 17 | Wool Sweater | Clothing | 234 | $79.99 |
| 18 | Air Fryer | Home | 89 | $129.99 |
| 19 | Tennis Racket | Sports | 156 | $149.99 |
| 20 | Coffee Beans Premium | Food & Beverage | 678 | $32.99 |
| 21 | USB-C Hub | Electronics | 423 | $59.99 |
| 22 | Linen Shirt | Clothing | 312 | $54.99 |
| 23 | Vacuum Cleaner | Home | 67 | $249.99 |
| 24 | Basketball | Sports | 534 | $29.99 |
| 25 | Olive Oil Extra Virgin | Food & Beverage | 892 | $19.99 |
| 26 | Mechanical Keyboard | Electronics | 145 | $119.99 |
| 27 | Winter Coat | Clothing | 89 | $189.99 |
| 28 | Blender Pro | Home | 234 | $89.99 |
| 29 | Dumbbells Set | Sports | 178 | $99.99 |
| 30 | Almond Butter | Food & Beverage | 445 | $14.99 |
| 31 | Webcam HD | Electronics | 267 | $69.99 |
| 32 | Silk Scarf | Clothing | 156 | $39.99 |
| 33 | Toaster Oven | Home | 198 | $79.99 |
| 34 | Jump Rope | Sports | 789 | $12.99 |
| 35 | Honey Raw Organic | Food & Beverage | 356 | $22.99 |
ID
Product
Export table data to CSV, JSON, or Excel format. Use data-exportable and optionally data-export-formats="csv,json,excel" to customize.
| Country | Capital | Population | GDP (Billion) | Continent |
|---|---|---|---|---|
| United States | Washington D.C. | 331M | $21,433B | North America |
| China | Beijing | 1.44B | $14,343B | Asia |
| Japan | Tokyo | 126M | $5,082B | Asia |
| Germany | Berlin | 84M | $3,846B | Europe |
| United Kingdom | London | 68M | $2,827B | Europe |
| India | New Delhi | 1.38B | $2,875B | Asia |
| France | Paris | 65M | $2,716B | Europe |
| Brazil | Brasília | 213M | $1,839B | South America |
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);
};
Full programmatic control over sorting, filtering, pagination, and more.
| Task | Priority | Assignee | Due Date |
|---|---|---|---|
| Implement login feature | High | John | Dec 5, 2024 |
| Fix navigation bug | Medium | Sarah | Dec 8, 2024 |
| Update documentation | Low | Mike | Dec 15, 2024 |
| Database optimization | High | Emily | Dec 3, 2024 |
| Add unit tests | Medium | David | Dec 10, 2024 |
| UI/UX improvements | Low | Lisa | Dec 20, 2024 |
| API integration | High | James | Dec 4, 2024 |
| Security audit | High | Anna | Dec 2, 2024 |
// 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();
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".
| ID | Project | Client | Status | Budget |
|---|---|---|---|---|
| 101 | Website Redesign | Acme Corp | Active | $25,000 |
| 102 | Mobile App | TechStart | On Hold | $45,000 |
| 103 | E-commerce Platform | ShopMax | Active | $75,000 |
| 104 | Dashboard Analytics | DataViz Inc | Planning | $35,000 |
| 105 | CRM Integration | SalesForce | Cancelled | $50,000 |
| 106 | API Development | CloudNine | Active | $30,000 |
Pre-defined filter buttons for common filtering needs. Define filters via JavaScript configuration for instant one-click filtering.
// 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'
}
]
});
Quickly copy table data to clipboard in tab-separated format (paste-friendly for Excel). Add data-copyable to enable.
| Product | SKU | Quantity | Price |
|---|---|---|---|
| Laptop Pro 15" | LP-001 | 45 | $1,299 |
| Wireless Mouse | WM-202 | 230 | $49 |
| USB-C Hub | UC-303 | 89 | $79 |
| Mechanical Keyboard | MK-404 | 156 | $159 |
| Monitor 27" | MN-505 | 67 | $449 |
| Webcam HD | WC-606 | 312 | $89 |
...
Apply styles, badges, icons, or progress bars based on cell values. Configure rules per column to highlight important data.
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' }
]
}
]
});
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.
| Product Name | Category | Price | Stock |
|---|---|---|---|
| Wireless Headphones | Electronics | 89 | 45 |
| Running Shoes | Sports | 129 | 78 |
| Coffee Maker | Home | 69 | 23 |
| Yoga Mat | Sports | 35 | 120 |
| Desk Lamp | Home | 45 | 67 |
// 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 }
]
});
Automatically calculate and display aggregations at the bottom of the table. Supports sum, average, count, min, and max for numeric columns.
// 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'
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.
| Order # | Customer | Date | Total | Status |
|---|---|---|---|---|
| ORD-2024-001 | Alice Johnson | Nov 28, 2024 | $249.99 | Delivered |
| ORD-2024-002 | Bob Smith | Nov 27, 2024 | $89.50 | Shipped |
| ORD-2024-003 | Carol Davis | Nov 26, 2024 | $567.00 | Processing |
| ORD-2024-004 | David Miller | Nov 25, 2024 | $1,250.00 | Delivered |
| ORD-2024-005 | Eva Wilson | Nov 24, 2024 | $45.00 | Cancelled |
// 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);
});
Drag column borders to resize. Minimum width is configurable (default 100px). Use keyboard arrows for fine-tuning.
| ID | Product Name | Description | Price | Category |
|---|---|---|---|---|
| PRD-001 | Wireless Keyboard | Ergonomic design with backlit keys | $79.99 | Electronics |
| PRD-002 | USB-C Hub | 7-in-1 multiport adapter | $49.99 | Accessories |
| PRD-003 | Monitor Stand | Adjustable height aluminum stand | $129.00 | Furniture |
<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);
});
Drag and drop column headers to rearrange columns. Column order is preserved in saved views.
| Date | Event | Location | Attendees | Status |
|---|---|---|---|---|
| Dec 15, 2024 | Annual Conference | New York | 500 | Confirmed |
| Dec 20, 2024 | Product Launch | San Francisco | 200 | Planning |
| Jan 10, 2025 | Training Workshop | Chicago | 75 | Open |
// 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);
});
Pin columns to the left or right edge. They stay visible while scrolling horizontally. Great for ID or action columns.
// 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');
When rows are selected, a floating action bar appears with batch operations. Fully configurable actions including status changes.
| Ticket # | Subject | Priority | Status | Assignee |
|---|---|---|---|---|
| TKT-001 | Login page not loading | High | Active | Alice |
| TKT-002 | Password reset broken | Critical | Active | Bob |
| TKT-003 | Feature request: Dark mode | Low | Pending | Carol |
| TKT-004 | Export fails for large datasets | Medium | Active | David |
| TKT-005 | Mobile layout issues | Medium | Inactive | Eve |
<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
});
Save and load view configurations including sort, filters, column visibility, widths, and order. Perfect for dashboards where users need different data perspectives.
| Project | Manager | Budget | Progress % | Deadline | Status |
|---|---|---|---|---|---|
| Website Redesign | Alice | $50,000 | 75 | Jan 15, 2025 | On Track |
| Mobile App v2 | Bob | $120,000 | 40 | Mar 1, 2025 | At Risk |
| API Integration | Carol | $30,000 | 90 | Dec 20, 2024 | Completed |
| Database Migration | David | $75,000 | 20 | Feb 28, 2025 | Delayed |
// 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);
});
Expand the table to fill the entire viewport for data-intensive work. Press Escape or click the button again to exit.
| SKU | Product | Warehouse | Qty | Reorder Point | Status |
|---|---|---|---|---|---|
| SKU-A001 | Widget Pro | Warehouse A | 250 | 50 | In Stock |
| SKU-A002 | Gadget Plus | Warehouse A | 45 | 100 | Low Stock |
| SKU-B001 | Component X | Warehouse B | 1200 | 200 | In Stock |
| SKU-B002 | Assembly Kit | Warehouse B | 0 | 25 | Out of Stock |
| SKU-C001 | Premium Bundle | Warehouse C | 89 | 30 | In Stock |
Click the expand icon () in the toolbar to enter full-page mode.
// 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);
});
Test features in playground.html
Browse all RSL components
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