🤩
Windframe Import update is finally here!

EditableTable

React Bootstrap 5 EditableTable

The Contrast React Bootstrap 5 Editable component allows you to create tables you can edit on the website. You can add and remove rows, change texts and informaton within cells.

Importing the React Bootstrap 5 EditableTable Component

To use the Contrast React Bootstrap 5 EditableTable component, you import CDBTimePicker into your project.

js
import { CDBEditableTable } from "cdbreact";

Default EditableTable

Pro Component

In this tutorial we use the CDBCard component for the table body. Check out the docs for more understanding.

React Bootstrap 5 EditableTable Component
js
import React from "react";
import { CDBEditableTable, CDBCard, CDBCardBody, CDBContainer } from "cdbreact";
export const EditableTable = () => {
const columns = ["Fullname", "Age", "Company Name", "City", "Country"];
const 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"]
];
return (
<CDBContainer>
<CDBCard>
<CDBCardBody>
<CDBEditableTable striped bordered data={data} columns={columns}/>
</CDBCardBody>
</CDBCard>
</CDBContainer>
);
};

API Reference: Contrast React Bootstrap 5 EditableTable Props

This section will build on your information about the props you get to use with the Contrast React Bootstrap 5 EditableTable component. You will find out what these props do, their default values, and how you would use them in your code.

The table below lists other prop options of the CDBEditableTable component.

NameTypeDefaultDescriptionExample
classNameStringAdds custom classesAdds custom classes<CDBEditableTable className="myClass" ... />
tagStringdivChanges default input tag<CDBEditableTable tag="input" ... />
autoWidthBooleanfalseAdds w-auto to the className<CDBEditableTable autoWidth .../>
borderedBooleanfalseAdds borders on all sides of the table and cells.<CDBEditableTable bordered .../>
borderlessBooleanfalseRemoves borders on all sides of the table and cells.<CDBEditableTable borderless .../>
dataArrayBinds your data into the component.<CDBEditableTable data = {['Aurelia Vega', 30, 'Depends']} .../>
columnsArraySpecify headers and number of columns<CDBEditableTable columns={['Person Name', 'Age', 'Company Name']} .../>
hoverBooleanfalseEnables a hover state on table rows within a table body.<CDBEditableTable hover .../>
responsiveBooleanMakes table responsive across all viewports<CDBEditableTable responsive .../>
responsiveSmBooleanMakes table responsive up to the small breakpoint<CDBEditableTable responsiveSm .../>
responsiveMdBooleanMakes table responsive up to the medium breakpoint<CDBEditableTable responsiveMd .../>
responsiveLgBooleanMakes table responsive up to the large breakpoint<CDBEditableTable responsiveLg .../>
responsiveXlBooleanMakes table responsive up to the extra large breakpoint<CDBEditableTable responsiveXl .../>
hoverBooleanfalseEnables a hover state on table rows within a table body.<CDBEditableTable hover .../>
smallBooleanfalseMakes tables more compact by cutting cell padding in half.<CDBEditableTable small .../>
stripedBooleanfalseAdds zebra-striping to any table row within the table body.<CDBEditableTable striped .../>

Trying to build out all user interfaces and components for your website or web app from scratch can become a very tedious task. A huge reason why we created Contrast Bootstrap to help reduce the amount of time we spend doing that, so we can focus on building some other aspects of the project. Contrast Bootstrap PRO consists of a UI Kit featuring over 10000+ component variants. Together with a template of 5 admin dashboards and 23+ additional multipurpose pages template for building almost any type of website or web app. You can view a demo and learn more about Contrast by clicking here.Download the free react template

ad-banner

Contrast Bootstrap PRO was built using the most popular CSS framework Bootstrap to help build your next landing, admin SAAS, prelaunch etc project with a clean, prebuilt and well documented template and UI components.Learn more about Contrast