{"id":11086,"date":"2022-04-11T10:16:00","date_gmt":"2022-04-11T10:16:00","guid":{"rendered":"https:\/\/ui-lib.com\/blog\/?p=11086"},"modified":"2022-08-04T07:18:32","modified_gmt":"2022-08-04T07:18:32","slug":"reactjs-table-libraries","status":"publish","type":"post","link":"https:\/\/ui-lib.com\/blog\/reactjs-table-libraries\/","title":{"rendered":"Top ReactJS Table Libraries in 2022"},"content":{"rendered":"\n<p>Tables are common in web applications. As there are so many free table libraries available, creating and styling a Reactjs table manually is not necessary. So, we&#8217;ve carefully chosen a list of the top ReactJS table libraries. We&#8217;ll go through all the benefits and drawbacks of each library. Also, we will learn all the installation processes and examples. <\/p>\n\n\n\n<p>As React has such a large ecosystem, there are numerous third-party reactjs table libraries. So, let us look at some of the best Reactjs Table Libraries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-material-table-reactjs-table\">1. Material Table &#8211; Reactjs Table<\/h2>\n\n\n\n<p>In a React application, the material table is a powerful way to represent data in a table format. Moreover, the elements are styled by Material UI guidelines. It is one of the most popular open-source libraries in the React space and offers a variety of individual components. Depending on the complexity, we can use these components to tackle the styling. This library&#8217;s most recent version requires a minimum React version of&nbsp;<code>16.8.5<\/code>.<\/p>\n\n\n\n<p>Install the library in a React app from a terminal window and run the following commands to see it in action:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yarn add material-table @material-ui\/core<\/pre>\n\n\n\n<p>Then&nbsp;include&nbsp;Material&nbsp;Icons.&nbsp;There&nbsp;are&nbsp;two&nbsp;approaches&nbsp;to&nbsp;this.&nbsp;The&nbsp;first&nbsp;method&nbsp;is&nbsp;to&nbsp;simply&nbsp;import&nbsp;the&nbsp;Material&nbsp;Icons&nbsp;font&nbsp;into&nbsp;the&nbsp;file&nbsp;using&nbsp;HTML.&nbsp;<code>public\/index.html<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;link\n  rel=\"stylesheet\"\n  href=\"https:\/\/fonts.googleapis.com\/icon?family=Material+Icons\"\n\/&gt;<\/pre>\n\n\n\n<p>Alternatively, you can install the&nbsp;<code>@material-ui\/icons<\/code>&nbsp;package in the React app:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yarn add @material-ui\/icons<\/pre>\n\n\n\n<p>The data provided to a React app in a real-world application comes from an external API. Inside the&nbsp;<code>src\/<\/code>&nbsp;directory, create a new file called &nbsp;<code>data.js<\/code>&nbsp; and add the following code snippet:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">export const data = [\n  {\n    id: 1,\n    title: 'The Hunger Games',\n    authors: 'Suzanne Collins',\n    num_pages: 374,\n    rating: 4.33\n  },\n  {\n    id: 2,\n    title: 'Harry Potter and the Order of the Phoenix',\n    authors: 'J.K. Rowling',\n    num_pages: 870,\n    rating: 4.48\n  },\n  {\n    id: 3,\n    title: 'To Kill a Mockingbird',\n    authors: 'Harper Lee',\n    num_pages: 324,\n    rating: 4.27\n  },\n  {\n    id: 4,\n    title: 'Pride and Prejudice',\n    authors: 'Jane Austen',\n    num_pages: 279,\n    rating: 4.25\n  },\n  {\n    id: 5,\n    title: 'Twilight',\n    authors: 'Stephenie Meyer',\n    num_pages: 498,\n    rating: 3.58\n  },\n  {\n    id: 6,\n    title: 'The Book Thief',\n    authors: 'Markus Zusak',\n    num_pages: 552,\n    rating: 4.36\n  }\n];<\/pre>\n\n\n\n<p>Then create a new file called&nbsp;<code>MTable.js<\/code>&nbsp;and import the material-table library and the array of dummy data:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import MaterialTable from 'material-table';\nimport { data } from '..\/data';<\/pre>\n\n\n\n<p>Since material-table is a React component, you can define a custom component like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const MTable = () =&gt; {\n  \/\/...\n};\nexport default MTable;<\/pre>\n\n\n\n<p>The material-table library anticipates receiving two props. The prop &nbsp;<code>data<\/code>&nbsp; is used to display the data in a row format. The number of columns is defined by another prop &nbsp;<code>columns<\/code>&nbsp;. It is an array that expects the title of each column as the heading of the specific column and the original &nbsp;<code>field<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const columns = [\n  { title: 'Title', field: 'title' },\n  { title: 'Author', field: 'authors' },\n  { title: 'Page Count', field: 'num_pages' },\n  { title: 'Rating', field: 'rating' }\n];<\/pre>\n\n\n\n<p>A third prop on the<code>&lt;MaterialTable&nbsp;\/&gt;<\/code> a component called &nbsp;<code>title<\/code>&nbsp;can be used to give the table a title as shown below:<a href=\"https:\/\/blog.logrocket.com\/the-top-react-table-libraries-to-use-in-2021\/\" target=\"_blank\" rel=\"noopener\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">return (\n  &lt;div style={{ maxWidth: '100%' }}&gt;\n    &lt;MaterialTable columns={columns} data={data} title='Books Directory' \/&gt;\n  &lt;\/div&gt;\n);<\/pre>\n\n\n\n<p>To see it in action, import the custom table component in the&nbsp;<code>App.js<\/code>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import MTable from '.\/components\/MTable';\nfunction App() {\n  return (\n    &lt;div style={{ padding: '30px' }}&gt;\n      &lt;h1&gt;Material Table Example&lt;\/h1&gt;\n      &lt;MTable \/&gt;\n    &lt;\/div&gt;\n  );\n}\nexport default App;<\/pre>\n\n\n\n<p>By default, the material-table library displays a search bar and pagination.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"467\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-1.png\" alt=\"reactjs table library - material table example\" class=\"wp-image-11096\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-1.png 627w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-1-300x223.png 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/figure><\/div>\n\n\n\n<p>You can customize the view of the table by adding a fourth prop called&nbsp;<code>options<\/code>&nbsp;that is an object and is used to customize the table.<\/p>\n\n\n\n<p>Add the following prop to&nbsp;<code>&lt;MaterialTable\/&gt;<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import { useState } from 'react';\nimport MaterialTable from 'material-table';\nimport { data } from '..\/data';\nconst MTable = () =&gt; {\n  const [selectedRow, setSelectedRow] = useState(null);\n  const columns = [\n    { title: 'Title', field: 'title' },\n    { title: 'Author', field: 'authors' },\n    { title: 'Page Count', field: 'num_pages' },\n    { title: 'Rating', field: 'rating' }\n  ];\n  return (\n    &lt;div style={{ maxWidth: '100%' }}&gt;\n      &lt;MaterialTable\n        columns={columns}\n        data={data}\n        title='Books Directory'\n        onRowClick={(evt, selectedRow) =&gt;\n          setSelectedRow(selectedRow.tableData.id)\n        }\n        options={{\n          search: false,\n          rowStyle: rowData =&gt; ({\n            backgroundColor:\n              selectedRow === rowData.tableData.id ? '#67aeae' : '#FFF'\n          })\n        }}\n      \/&gt;\n    &lt;\/div&gt;\n  );\n};\nexport default MTable;<\/pre>\n\n\n\n<p>Here is the output:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"460\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-2.png\" alt=\"reactjs table example\" class=\"wp-image-11097\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-2.png 598w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-2-300x231.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n\n<p><a class=\"button\" href=\"https:\/\/github.com\/mbrn\/material-table\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>GitHub<\/strong><\/a>       <a class=\"button\" href=\"https:\/\/material-table.com\/#\/docs\/get-started\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Official Documentation<\/strong><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-react-bootstrap-table2\">2. React Bootstrap Table2<\/h2>\n\n\n\n<p>If you&#8217;re using Bootstrap-based UI components in your React app, <a href=\"https:\/\/react-bootstrap-table.github.io\/react-bootstrap-table2\" target=\"_blank\" rel=\"noreferrer noopener\">react-react-bootstrap-table2<\/a> is a perfect match for displaying data tables and using the same design system. It has a cleaner design and a smaller bundle size, which eliminates the need to handle too much business logic.<\/p>\n\n\n\n<p>To install it in a React app, run the following command from a terminal window:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yarn add react-bootstrap-table-next<\/pre>\n\n\n\n<p>Then, import the Bootstrap CSS library into the React app. This is usually done inside the&nbsp;<code>App.js<\/code>&nbsp;or&nbsp;<code>index.js<\/code>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import 'react-bootstrap-table-next\/dist\/react-bootstrap-table2.min.css';<\/pre>\n\n\n\n<p>Then, create a custom component file called&nbsp;<code>BTable.js<\/code>&nbsp;and import the component&nbsp;<code>BootstrapTable<\/code>&nbsp;from the&nbsp;<code>react-bootstrap-table-next<\/code>&nbsp;library.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import BootstrapTable from 'react-bootstrap-table-next';\nimport { data } from '..\/data';<\/pre>\n\n\n\n<p>Each data array field&nbsp;you want to display as an object is here&nbsp;as an array. The value of &nbsp;<code>dataField<\/code>&nbsp; reflects the actual field from the &nbsp;<code>data<\/code>&nbsp; array, while the  <code>text<\/code>&nbsp; in each object represents the custom header name of each column:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const BTable = () =&gt; {\n  const columns = [\n    { text: 'Title', dataField: 'title' },\n    { text: 'Author', dataField: 'authors' },\n    { text: 'Page Count', dataField: 'num_pages' },\n    { text: 'Rating', dataField: 'rating' }\n  ];\n  return (\n    &lt;div style={{ maxWidth: '100%' }}&gt;\n      &lt;BootstrapTable columns={columns} data={data} keyField='id' \/&gt;\n    &lt;\/div&gt;\n  );\n};\nexport default BTable;<\/pre>\n\n\n\n<p>Here is a basic table output:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"363\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-3.png\" alt=\"reactjs table bootstrap datatable\" class=\"wp-image-11098\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-3.png 579w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/Image-3-300x188.png 300w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/figure><\/div>\n\n\n\n<p>There are two methods for creating custom settings. The first is to provide fundamental capabilities such as sorting data in columns here, in this manner:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const columns = [\n  { text: 'Title', dataField: 'title', sort: true },\n  { text: 'Author', dataField: 'authors' },\n  { text: 'Page Count', dataField: 'num_pages' },\n  { text: 'Rating', dataField: 'rating', sort: true }\n];<\/pre>\n\n\n\n<p>In the preceding code snippet, we add a third property <code>sort<\/code> with a boolean value of  <code>true<\/code> to the data fields <code>title<\/code> and <code>rating<\/code>. This enables sorting in these two columns based on ascending and descending values.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"299\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-4.png\" alt=\"bootstrap data table example\" class=\"wp-image-11099\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-4.png 682w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-4-300x132.png 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/figure><\/div>\n\n\n\n<p><a class=\"button\" href=\"https:\/\/github.com\/react-bootstrap-table\/react-bootstrap-table2\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>GitHub<\/strong><\/a>       <a class=\"button\" href=\"https:\/\/react-bootstrap-table.github.io\/react-bootstrap-table2\/docs\/getting-started.html\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Official Documentation<\/strong><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-mui-datatables\">3. MUI Datatables<\/h2>\n\n\n\n<p>This list includes yet another Material UI-based data table component. If you&#8217;re using a Material UI-based design system in your React project, <a href=\"https:\/\/www.material-ui-datatables.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">MUI-Datatables<\/a> is a great way to represent data tables. Filtering, row selection, searching, exporting to CSV format, sorting, and other features are available.<\/p>\n\n\n\n<p>To see it in action, install it in a React project first:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yarn add mui-datatables @material-ui\/core @material-ui\/icons<\/pre>\n\n\n\n<p>Then, in <code>MUITable.js<\/code>, create a custom component file and import the component from<code>mui-datatables<\/code>. Let&#8217;s use the same dummy data set to display the data inside the table component, so import it from the<code>src\/data.js<\/code>file as well:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import MUIDataTable from 'mui-datatables';\nimport { data } from '..\/data';<\/pre>\n\n\n\n<p> <code>columns<\/code> are here&nbsp;as an array, and each field from the data array that you want to display as an object is here as&nbsp;an object. Each object&#8217;s <code>label<\/code> represents the column&#8217;s custom header name:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const MUITable = () =&gt; {\n  const columns = [\n    { label: 'Title', name: 'title' },\n    { label: 'Author', name: 'authors' },\n    { label: 'Page Count', name: 'num_pages', options: { sort: true } },\n    { label: 'Rating', name: 'rating' }\n  ];\n  const options = {\n    filterType: 'checkbox'\n  };\n  return (\n    &lt;div style={{ maxWidth: '100%' }}&gt;\n      &lt;MUIDataTable\n        columns={columns}\n        data={data}\n        title='Books Directory'\n        options={options}\n      \/&gt;\n    &lt;\/div&gt;\n  );\n};\nexport default MUITable;<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"459\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-5.png\" alt=\"material ui datatable\" class=\"wp-image-11100\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-5.png 726w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-5-300x190.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/figure><\/div>\n\n\n\n<p>Other features such as searching, hiding a specific column, and filtering a value are also here.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"511\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-6.png\" alt=\"material ui datatable\" class=\"wp-image-11101\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-6.png 725w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-6-300x211.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/figure><\/div>\n\n\n\n<p><a class=\"button\" href=\"https:\/\/github.com\/gregnb\/mui-datatables\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>GitHub<\/strong><\/a>       <a class=\"button\" href=\"https:\/\/www.material-ui-datatables.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Official Documentation<\/strong><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-react-virtualized-reactjs-table\">4. react virtualized &#8211; Reactjs Table<\/h2>\n\n\n\n<p>This is now a multi-purpose component library that supports large lists and tables of data. It supports simple table forms as well as grid, masonry, list, and collection formats for data tables. Because it supports a variety of formats and dynamic data lists, it is one of the most popular open-source component libraries on this list.<\/p>\n\n\n\n<p>Install it in a React app by running the following command from a terminal window:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yarn add react-virtualized<\/pre>\n\n\n\n<p>Now you have to import&nbsp;<code>react-virtualized\/styles.css<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import { Column, Table } from 'react-virtualized';\nimport 'react-virtualized\/styles.css';\nimport { data } from '..\/data';<\/pre>\n\n\n\n<p>The&nbsp;<code>Column<\/code>&nbsp;component shows each component. It accepts a&nbsp;<code>label<\/code>&nbsp;prop that projects the header title of the column. The&nbsp;<code>dataKey<\/code>&nbsp;prop represents the field in the data array and a custom value for&nbsp;<code>width<\/code>&nbsp;for each column:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const RVTable = () =&gt; {\n  return (\n    &lt;div style={{ maxWidth: '100%' }}&gt;\n      &lt;Table\n        headerHeight={20}\n        width={920}\n        height={300}\n        rowHeight={30}\n        rowGetter={({ index }) =&gt; data[index]}\n        rowCount={data.length}\n      &gt;\n        &lt;Column label='Title' dataKey='title' width={400} \/&gt;\n        &lt;Column label='Author' dataKey='authors' width={200} \/&gt;\n        &lt;Column label='Pages' dataKey='num_pages' width={100} \/&gt;\n        &lt;Column label='Rating' dataKey='rating' width={100} \/&gt;\n      &lt;\/Table&gt;\n    &lt;\/div&gt;\n  );\n};\nexport default RVTable;<\/pre>\n\n\n\n<p>Here is the output:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"310\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-7.png\" alt=\"reactjs example virtualized datatable\" class=\"wp-image-11102\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-7.png 622w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-7-300x150.png 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/figure><\/div>\n\n\n\n<p><strong><a class=\"button\" href=\"https:\/\/github.com\/bvaughn\/react-virtualized\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>      <a class=\"button\" href=\"https:\/\/github.com\/bvaughn\/react-virtualized\/blob\/master\/docs\/Table.md\" target=\"_blank\" rel=\"noreferrer noopener\">Official Documentation<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-react-table-reactjs-table\">5. React Table &#8211; Reactjs Table <\/h2>\n\n\n\n<p><a href=\"https:\/\/react-table.tanstack.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">React Table<\/a> is a small package that allows you to display data in a table format. It is a utility library rather than a table component library, as are the other libraries on this list.<\/p>\n\n\n\n<p>To see it in action, first install it in a terminal window by typing the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yarn add react-table<\/pre>\n\n\n\n<p>Then, name your custom component file <code>RTTable.js<\/code>. Because it supports React hooks, import the hook <code>useTable<\/code> from the the <code>react-table<\/code> library.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import BootstrapTable from 'react-bootstrap-table-next';\nimport { data } from '..\/data';<\/pre>\n\n\n\n<p>To define the structure of the columns of the table, add the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const RTTable = () =&gt; {\n  const columns = [\n    {\n      Header: 'Title',\n      accessor: 'title'\n    },\n    {\n      Header: 'Author',\n      accessor: 'authors'\n    },\n    {\n      Header: 'Pages',\n      accessor: 'num_pages'\n    },\n    {\n      Header: 'Rating',\n      accessor: 'rating'\n    }\n  ];\n  \/\/...\n};\nexport default RTTable;<\/pre>\n\n\n\n<p>The&nbsp;<code>accessor<\/code>&nbsp;property has the same value as the key in the&nbsp;<code>data<\/code>&nbsp;array. To ensure that the array of data is recreated on every render, React Table library recommends the use of the&nbsp;<code>useMemo<\/code>&nbsp;hook.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import { useMemo } from 'react';\nimport { useTable } from 'react-table';\nimport { data as mockData } from '..\/data';\nconst RTTable = () =&gt; {\n  const data = useMemo(() =&gt; mockData, []);\n  const columns = useMemo(\n    () =&gt; [\n      {\n        Header: 'Title',\n        accessor: 'title'\n      },\n      {\n        Header: 'Author',\n        accessor: 'authors'\n      },\n      {\n        Header: 'Pages',\n        accessor: 'num_pages'\n      },\n      {\n        Header: 'Rating',\n        accessor: 'rating'\n      }\n    ],\n    []\n  );\n  \/\/ ...\n};<\/pre>\n\n\n\n<p>Only when the memoized value is changed does React Table calculate the columns based on the data provided. After defining&nbsp;the columns and data array, pass them as arguments to the <code>useTable<\/code> hook to create a table instance.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const tableInstance = useTable({ columns, data });\nconst {\n  getTableProps,\n  getTableBodyProps,\n  headerGroups,\n  rows,\n  prepareRow\n} = tableInstance;\nreturn (\n  &lt;table {...getTableProps()} style={{ border: 'solid 1px blue' }}&gt;\n    &lt;thead&gt;\n      {headerGroups.map(headerGroup =&gt; (\n        &lt;tr {...headerGroup.getHeaderGroupProps()}&gt;\n          {headerGroup.headers.map(column =&gt; (\n            &lt;th\n              {...column.getHeaderProps()}\n              style={{\n                background: '#657',\n                color: 'white',\n                fontWeight: 'bold'\n              }}\n            &gt;\n              {column.render('Header')}\n            &lt;\/th&gt;\n          ))}\n        &lt;\/tr&gt;\n      ))}\n    &lt;\/thead&gt;\n    &lt;tbody {...getTableBodyProps()}&gt;\n      {rows.map(row =&gt; {\n        prepareRow(row);\n        return (\n          &lt;tr {...row.getRowProps()}&gt;\n            {row.cells.map(cell =&gt; {\n              return (\n                &lt;td\n                  {...cell.getCellProps()}\n                  style={{\n                    padding: '10px',\n                    border: 'solid 0.6px gray',\n                    background: '#fff'\n                  }}\n                &gt;\n                  {cell.render('Cell')}\n                &lt;\/td&gt;\n              );\n            })}\n          &lt;\/tr&gt;\n        );\n      })}\n    &lt;\/tbody&gt;\n  &lt;\/table&gt;\n);<\/pre>\n\n\n\n<p>Here is the output for the above basic example:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"420\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-8.png\" alt=\"React table datatable example \" class=\"wp-image-11103\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-8.png 610w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/04\/image-8-300x207.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/figure><\/div>\n\n\n\n<p><a class=\"button\" href=\"https:\/\/github.com\/tannerlinsley\/react-table\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>GitHub<\/strong><\/a>\u00a0     <strong> <a class=\"button\" href=\"https:\/\/react-table.tanstack.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Official Documentation<\/a><\/strong>       <a class=\"button\" href=\"https:\/\/react-table.tanstack.com\/docs\/examples\/footers\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Examples<\/strong><\/a>\u00a0<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>A Bonus React Table Library<\/strong> <strong>&#8211; Awesome React Tables<\/strong> \ud83d\udc4c\ud83e\udd73<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/react-table-library.com\/?path=\/story\/getting-started-installation--page\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"467\" src=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/08\/react-table-library.png\" alt=\"Awesome React Tables\" class=\"wp-image-12356\" srcset=\"https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/08\/react-table-library.png 700w, https:\/\/ui-lib.com\/blog\/wp-content\/uploads\/2022\/08\/react-table-library-300x200.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><strong><a class=\"button\" href=\"https:\/\/github.com\/table-library\/react-table-library\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a><\/strong>       <strong><a class=\"button\" href=\"https:\/\/react-table-library.com\/?path=\/story\/getting-started-installation--page\" target=\"_blank\" rel=\"noreferrer noopener\">Official Documentation<\/a><\/strong>     <strong><a class=\"button\" href=\"https:\/\/react-tables.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Examples<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-wrapping-up\">Wrapping Up<\/h2>\n\n\n\n<p>These component libraries&#8217; purpose is to provide a good development experience while allowing you to represent data in a table. Because of the development costs, some of the integrations these libraries provide are difficult to establish from scratch. Therefore, we&#8217;ve gone over all of the steps you&#8217;ll need to take to put them into action. With these items, we conclude this blog post on Best React Table Libraries.<\/p>\n\n\n\n<p>Thank you for reading.<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Our Reactjs Product<\/h2>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-ui-lib wp-block-embed-ui-lib\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Q736v32cgJ\"><a href=\"https:\/\/ui-lib.com\/downloads\/matx-pro-react-admin\/\">MatX Pro &#8211; React Admin Template<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;MatX Pro &#8211; React Admin Template&#8221; &#8212; Ui Lib\" src=\"https:\/\/ui-lib.com\/downloads\/matx-pro-react-admin\/embed\/#?secret=Yx7J0ezPoT#?secret=Q736v32cgJ\" data-secret=\"Q736v32cgJ\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Similar Blog Posts<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/ui-lib.com\/blog\/best-react-date-picker-components\/\">Free React Date Picker Components<\/a><\/li><li><a href=\"https:\/\/ui-lib.com\/blog\/best-react-chart-libraries\/\">Open Source React Chart Libraries<\/a><\/li><li><a href=\"https:\/\/ui-lib.com\/blog\/react-boilerplates\/\">React Boilerplates You Should Not Miss<\/a><\/li><li><a href=\"https:\/\/ui-lib.com\/blog\/best-react-admin-templates\/\">Admin Templates with React<\/a><\/li><li><a href=\"https:\/\/ui-lib.com\/blog\/react-static-site-generators\/\">React Static Site Generators<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Tables are common in web applications. As there are so many free table libraries available, creating and styling a Reactjs table manually is not necessary.&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/ui-lib.com\/blog\/reactjs-table-libraries\/\">Continue reading<span class=\"screen-reader-text\">Top ReactJS Table Libraries in 2022<\/span><\/a><\/div>\n","protected":false},"author":3,"featured_media":11087,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141],"tags":[648,647,641,643,642,645,644,649,646],"class_list":["post-11086","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react","tag-best-reactjs-table","tag-best-reactjs-table-libraries","tag-react-table-libraries","tag-reactjs-table","tag-reactjs-table-libraries","tag-table-libraries","tag-table-libraries-for-react","tag-top-reactjs-table","tag-top-reactjs-table-libraries","entry"],"_links":{"self":[{"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/posts\/11086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/comments?post=11086"}],"version-history":[{"count":14,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/posts\/11086\/revisions"}],"predecessor-version":[{"id":12358,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/posts\/11086\/revisions\/12358"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/media\/11087"}],"wp:attachment":[{"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/media?parent=11086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/categories?post=11086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ui-lib.com\/blog\/wp-json\/wp\/v2\/tags?post=11086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}