Interactive And Customizable Data Table/Grid Web Component – Active Table
The Active Table web component delivers a customizable, interactive, dynamic table experience in your browser.
It allows users to add, remove, move, or edit rows and columns seamlessly. With built-in text validation, sorting, pagination, and filtering, managing vast amounts of data has never been easier.
Plus, the unique column types like Currency, Select, Date, Checkbox, and more ensure that every data type is catered to.
The import/export functionality supports various file formats (csv, xls, xlsx, ods, txt, etc), making data transfer a breeze.
Its responsive design ensures that your table looks perfect on any device. Overflow handling means no more data spillage.
The reactive dimensions automatically adjust to content, and programmatic cell updates allow for dynamic changes on the fly.
1. Install & download.
# NPM $ npm i active-table
2. Import the Active Table from a CDN.
<script src="https://unpkg.com/active-table@1.0.16/dist/activeTable.bundle.js" type="module"></script>
3. Add the active-table component to your project and pass in your tabular data to the data prop.
<active-table data='Your Data Array Here' ></active-table>
4. Available component props to customize the table.
<active-table
tableStyle='{CSS Styles here}
overflow='{"maxHeight": "200px", "maxWidth": "100%"}'
frameComponentsStyles='{
"styles": {
CSS Styles here
},
"inheritHeaderColors": false
}'
auxiliaryStyle="
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-thumb {
background-color: #54a7ff;
border-radius: 5px;
}"
data='Your Data Array Here'
defaultText="-"
isDefaultTextRemovable="true"
cellStyle='{"borderBottom": "1px solid black", "borderRight": "1px solid black", "backgroundColor": "#fafafa"}'
isCellTextEditable="false"
rootCell='{"text": "Create", "styles": {"default": {"width": "50px"}, "hover": {"backgroundColor": "#e0f1ff"}}}'
spellCheck="true"
headerStyles='{
"default": {
"backgroundColor": "#efefef",
"borderBottom": "unset",
"fontWeight": "700",
"fontSize": "15px"
},
"hoverColors": {
"backgroundColor": "#d2d2d2"
}
}'
isHeaderTextEditable="false"
allowDuplicateHeaders="false"
displayHeaderIcons="false"
headerIconStyle='{
"filterColor": "brightness(0) saturate(100%) invert(16%) sepia(85%) saturate(1892%) hue-rotate(210deg) brightness(88%) contrast(103%)",
"scale": {"x": 1.5, "y": 1.5}
}'
stickyHeader="true"
dataStartsAtHeader="true"
rowHoverStyles='{"style":{"backgroundColor": "#d6d6d630"}}'
stripedRows='{"odd": {"backgroundColor": ""}, "even": {"backgroundColor": "#ebebeb7a"}}'
rowDropdown='{"displaySettings":{"isAvailable": true, "openMethod": {"overlayClick": true}}, "canEditHeaderRow": false}'
maxRows="5"
dragRows="true"
displayAddNewRow="true"
customColumnsSettings='[
{ "headerName": "Planet", "defaultText": "Insert Planet", "cellStyle": {"width": "150px"}, "isHeaderTextEditable": false },
{ "headerName": "Number", "cellStyle": {"backgroundColor": "#fdfdfd"}, "defaultColumnTypeName": "number", "isHeaderTextEditable": false },
{ "headerName": "Shape", "cellStyle": {"backgroundColor": "#f8f8f8"}, "defaultColumnTypeName": "Select", "isHeaderTextEditable": false },
{ "headerName": "Date Created", "cellStyle": {"backgroundColor": "#f1f1f1"}, "defaultColumnTypeName": "Date d-m-y", "isHeaderTextEditable": false }
]'
isColumnResizable="true"
columnResizerColors='{ "hover": "#87ddff", "click": "#369cfd" }'
columnDropdown='{
"displaySettings": {
"openMethod": {"overlayClick": true}},
"isSortAvailable": false,
"isMoveAvailable": false
}'
maxColumns="10"
dragColumns="true"
preserveNarrowColumns="true"
displayAddNewColumn="true"
displayIndexColumn="true"
defaultColumnTypeName="Label"
availableDefaultColumnTypes='["Number"]'
customColumnTypes='[{
"name": "Custom type",
"select": {
"options": ["Pass", "Fail"],
"canAddMoreOptions": false
},
"iconSettings": {
"reusableIconName": "select"
}}]'
pagination="true"
filter="true"
files='{"buttons": [{"import": true}, {"export": true}], "dragAndDrop": true}'
></active-table> 5. API methods.
// get data
tableElementRef.getdata();
// get details of columns
tableElementRef.getColumnsDetails();
// update cells
tableElementRef.updateCell({newText: "sample text", rowIndex: 1, columnIndex: 1});
// update table structure
tableElementRef.updateStructure({
structure: 'row',
isInsert: true,
index: -1,
data: ['New Planet', '12345', '500', '10', '357'],
});
// update tabular data
tableElementRef.updateData([
['Planet', 'Diameter', 'Mass', 'Moons', 'Density'],
['Mercury', 4879, 0.33, 0, 5429],
['Venus', 12104, 4.87, 0, 5243],
['Uranus', 51118, 86.8, 27, 1270],
['Pluto', 2376, 0.013, 5, 1850],
['Moon', 3475, 0.073, 0, 3340],
]);
// import file
tableElementRef.importFile();
// export file
tableElementRef.exportFile(); 6. Events.
tableElementRef.onCellUpdate = (cellUpdate) => { console.log(cellUpdate); });
tableElementRef.ondataUpdate = (dataUpdate) => { console.log(dataUpdate); };
tableElementRef.onColumnsUpdate = (columnsUpdate) => { console.log(columnsUpdate); };
tableElementRef.onRender = () => { console.log('Finished rendering'); }; v1.1.8 (02/26/2025)
v1.1.7 (05/13/2025)
v1.1.6 (01/15/2025)
v1.1.5 (03/01/2023)
v1.1.4 (02/02/2023)
v1.1.3 (02/01/2023)
v1.1.2 (01/08/2023)
v1.1.1 (01/02/2023)
v1.1.0 (12/21/2023)
v1.0.16 (11/15/2023)
v1.0.15 (11/13/2023)
v1.0.14 (11/05/2023)
v1.0.12 (11/03/2023)
v1.0.10 (10/29/2023)
v1.0.8 (10/28/2023)
v1.0.3 (10/04/2023)
v1.0.2 (10/03/2023)
v1.0.1 (10/01/2023)
v1.0.0 (09/30/2023)
v0.3.19 (09/28/2023)
The post Interactive And Customizable Data Table/Grid Web Component – Active Table appeared first on CSS Script.
In January, Qualcomm hinted to The Verge that it might finally bring its powerful Arm-based…
Students are seen on the campus of Columbia University on April 14, 2025, in New…
If you’ve been waiting to grab any video games, today might be the day. On…
I first took notice of Samson: A Tyndalston Story when its team of former Just…
Stardew Valley creator Eric Barone (ConcernedApe) has released a 10th anniversary video revealing, among other…
Highguard studio Wildlight Entertainment reportedly has less than 20 people remaining to work on the…
This website uses cookies.