JsonToTable Docs
v3.6The definitive reference for the JsonToTable library. Interactive Bootstrap tables from JSON with filters, sorting, paging, and export.
Overview
JsonToTable renders a responsive table from an array of objects (or from a JSON API),
then provides built-in filtering, searching, sorting, paging, and CSV export — all via a simple fluent API.
Key Features
- Auto columns or custom definition
- Modal filters (checkbox, text, range, etc)
- Global Search (Multi-word AND logic)
- Sortable Headers (ASC/DESC)
- CSV Export (Filtered or All)
Tech Stack
- Requires Bootstrap 5 (CSS + JS Bundle)
- Optional FontAwesome for icons
- Zero dependencies otherwise (Native JS)
Requirements
Include Bootstrap 5 and the library in your project.
Quick Start
1. Base Example (Auto-Columns)
Create a table using only the constructor and `.load()`.
2. Fetch from API
Public API
Most methods are chainable (fluent API style).
Configuration & UI
Use `.config()` to control pagination, UI elements, and behavior.
Example: Small Page Size
Columns Schema
The `columns` array defines how to read, label, and render data.
Example: Custom Labels & Disabled Sort
Render Modes
Built-in formatters for common data types.
render: "money"
Formats numbers with 2 decimals. Colors positive green and negative red.
render: "unixSecondsToLocal"
Converts Unix Timestamp (seconds) to local browser date string.
Live Render Example
Filters
Filters appear in the modal dialog. Each column can have a unique filter type.
Supported Types
text- Search/contains/startscheckbox- Multi-select unique valuesradio- Single select optionssign- Positive / Negative / Allnumber-range- Min / Max inputsdate-range- Date pickers (for unix times)
Example: Text & Range Filters
Row Actions
Add interactive buttons to every row. Requires idKey to identify rows.
CSV Export
The export button appears in the center of the footer.
- Click: Exports currently Filtered data.
- Shift + Click: Exports All data.
State Management
The library automatically saves the following to localStorage:
- Global search query
- Active sort column and direction
- All filter inputs and selections
State is restored on page load. Use resetFilters() to clear it.