EditableTable

EditableTable

With Angular Editable Bootstrap Table, you can add and remove rows and change text and information within cells. In-place editing on your website - based on JavaScript - is now easier and quicker.

Examples

image info

Default EditableTable example.

html
<CDBCard>
<CDBCardBody>
<CDBEditableTable [striped]=true [bordered]=true [data]='data' [columns]='columns' ></CDBEditableTable>
</CDBCardBody>
</CDBCard>
typescript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-editable-table',
templateUrl: './editable-table.component.html',
styleUrls: ['./editable-table.component.scss'],
})
export class EditableTableComponent implements OnInit {
columns = ['Fullname', 'Age', 'Company Name', 'City', 'Country'];
data = [
['Guerra Cortez', 45, 'Insectus', 'San Francisco', 'USA'],
['Elisa Gallagher', 31, 'Portica', 'London', 'United Kingdom'],
['Aurelia Vega', 30, 'Deepends', 'Madrid', 'Spain'],
['Guadalupe House', 26, 'Isotronic', 'Berlin', 'Germany'],
];
constructor() {}
ngOnInit(): void {}
}

API

Here in this section you will find information about required modules and available inputs, outputs, methods and events of this component.

Contrast EditableTable Bootstrap Modules used

import {EditabletableModule } from 'cdbangular';

API Reference: Contrast EditableTable Bootstrap Inputs

The table below shows the possible input of the EditableTable component.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"
autoWidthBooleanfalseAdds w-auto to the classNameautoWidth=true
borderedBooleanfalseAdds borders on all sides of the table and cells.bordered=true
borderlessBooleanfalseRemoves borders on all sides of the table and cells.borderless=true
dataArrayBinds your data into the component.data = ['Aurelia Vega', 30, 'Depends']
columnsArraySpecify headers and number of columnscolumns=['Person Name', 'Age', 'Company Name']
hoverBooleanfalseEnables a hover state on table rows within a table body.hover=true
responsiveBooleanMakes table responsive across all viewportsresponsive=true
responsiveSmBooleanMakes table responsive up to the small breakpointresponsiveSm=true
responsiveMdBooleanMakes table responsive up to the medium breakpointresponsiveMd=true
responsiveLgBooleanMakes table responsive up to the large breakpointresponsiveLg=true
responsiveXlBooleanMakes table responsive up to the extra large breakpointresponsiveXl=true
hoverBooleanfalseEnables a hover state on table rows within a table body.hover=true
smallBooleanfalseMakes tables more compact by cutting cell padding in half.small=true
stripedBooleanfalseAdds zebra-striping to any table row within the table body.striped=true