{"id":98802,"date":"2019-10-08T07:00:23","date_gmt":"2019-10-08T04:00:23","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=98802"},"modified":"2019-10-07T15:58:05","modified_gmt":"2019-10-07T12:58:05","slug":"reactjs-table-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html","title":{"rendered":"ReactJS Table Example"},"content":{"rendered":"<p>In this article we will build a ReactJS Table Example. ReactJS has shot to fame and has become the front end library of choice. We look at how we can build a table with a set of components and keep it as flexible and configurable as possible. We will add features like styling and sorting to our table component and provide a rich component that can be reused across applications.<\/p>\n<p>So without further delay let us get down to it and start off with our implementation. We will use the following set of tools for our example in this article. Some of these are optional and can be replaced with your favorites.<\/p>\n<ul class=\"wp-block-list\">\n<li><a aria-label=\"create-react-app (opens in a new tab)\" href=\"https:\/\/www.npmjs.com\/package\/create-react-app\" target=\"_blank\" rel=\"noreferrer noopener\">create-react-app<\/a> <\/li>\n<\/ul>\n<p>This is a helpful tool from the folks at Facebook to help us quickly generate the boilerplate code for a React application. We will use here to quickly get off the blocks.<\/p>\n<ul class=\"wp-block-list\">\n<li><a aria-label=\"React (opens in a new tab)\" href=\"https:\/\/www.npmjs.com\/package\/react\" target=\"_blank\" rel=\"noreferrer noopener\">React<\/a><\/li>\n<\/ul>\n<p>As the name of this article suggests we will be working with latest version of ReactJS. Just a not we will be using the brand new React Hooks and creating components as functions. React Hooks enable us to do all that was earlier only possible with class components.<\/p>\n<ul class=\"wp-block-list\">\n<li><a aria-label=\"Visual Studio Code IDE (opens in a new tab)\" href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Visual Studio Code IDE<\/a><\/li>\n<\/ul>\n<p>This is my favorite IDE but of course you are free to choose your own to work with.<\/p>\n<h2 class=\"wp-block-heading\">1. Application Structure<\/h2>\n<p>We use the below command to generate the initial application structure for this example. <\/p>\n<pre class=\"brush: bash;\">&gt;npx create-react-app react-table .\n<\/pre>\n<p>This command uses the npx tool to download a temporary copy of create-react-app and run it using the parameters passed. Once done the create-react-app package is disposed of. The generated application structure should look like below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"342\" height=\"726\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ApplicationStructureReactTableEx.jpg\" alt=\"ReactJS Table - Application Structure\" class=\"wp-image-99000\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ApplicationStructureReactTableEx.jpg 342w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ApplicationStructureReactTableEx-141x300.jpg 141w\" sizes=\"(max-width: 342px) 100vw, 342px\" \/><figcaption>Application Structure<\/figcaption><\/figure>\n<\/div>\n<p>I will discuss each of the components seen in the above screen grab in the following sections. As we build our own table component in ReactJS.<\/p>\n<h2 class=\"wp-block-heading\">2. Components<\/h2>\n<p>To begin with our design I will take a top down approach. As in starting with the top level components and diving down into the components at the bottom doing the grunt work.<\/p>\n<h3 class=\"wp-block-heading\">2.1 Table Component<\/h3>\n<p>This component will render a table as well as two child components we will build later. First of these will be THead and the second TBody. For the purpose of illustration I have created some sample data containing a list of some of the articles I have written over the years and links to them. This sample data resides in the SampleData.js file. We import it in the Table component and pass it down to child components responsible for displaying the data.<\/p>\n<p>Our code for the Table component will look like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Table.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">import React, { useState } from 'react';\nimport THead from '.\/THead';\nimport TBody from '.\/TBody';\nimport { columns, sampleData } from '.\/SampleData';\nimport { theme } from '.\/Table.Style';\n\nfunction Table(props) {\n    const [currenttheme, setCurrentTheme] = useState(theme.light);\n    const customRenderer = (row) =&gt; {\n        return &lt;a href={row.url}&gt;{row.title}&lt;\/a&gt;;\n    };\n    const columnRenderer = (column) =&gt; {\n        return column.slice(0, 1).toUpperCase() + \n               column.slice(1, column.length);\n    }\n    const switchTheme = ({ target }) =&gt; {\n        if (target.innerText.toUpperCase() === \"LIGHT\") {\n            setCurrentTheme(theme.light);\n        } else if (target.innerText.toUpperCase() === \"DARK\") {\n            setCurrentTheme(theme.dark);\n        }\n    }\n    return &lt;&gt;&lt;div&gt;\n        &lt;button style={currenttheme.button} \nonClick={switchTheme}&gt;Light&lt;\/button&gt;\n        &lt;button style={currenttheme.button} \nonClick={switchTheme}&gt;Dark&lt;\/button&gt;\n    &lt;\/div&gt;\n        &lt;table style={currenttheme.table}&gt;\n            &lt;THead theme={currenttheme} \ncolumnRenderer={columnRenderer} columns={columns}&gt;&lt;\/THead&gt;\n            &lt;TBody theme={currenttheme} \ncustomRenderer={customRenderer} columns={columns} rows={sampleData}  \n            &gt;&lt;\/TBody&gt;\n        &lt;\/table&gt;&lt;\/&gt;;\n\n}\nexport default Table;\n<\/pre>\n<p>As you can see in the code above we will be theming our table based on user selection. Also an advanced feature to allow the consumer of our component to provide a custom renderer for columns marked as such.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3 class=\"wp-block-heading\">2.2 THead Component<\/h3>\n<p>This component will render the headers of our table. It also accepts a customRenderer that is a method which is invoked for each header cell. The code of our THead component looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>THead.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">import React from \"react\";\nfunction THead(props) {\n    return &lt;thead&gt;\n        &lt;tr style={props.theme.column}&gt;\n            {props.columns.map(col =&gt; &lt;th style={props.theme.cell} \nkey={col.name}&gt;{props.columnRenderer(col.name)}&lt;\/th&gt;)}\n        &lt;\/tr&gt;\n    &lt;\/thead&gt;\n}\nexport default THead;\n<\/pre>\n<p>This simple component renders a thead with a table row. We loop over the columns passed in as props to generate individual column headers. Of note is the fact that we call the columnRenderer passed in through props with the column name parameter. In the column renderer passed in we process column headers to make the initial letter capital. The sample data deliberately has column names in all small letters for this demonstration.<\/p>\n<p>The sample column data passed into this component looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>SampleData.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">export const columns = [\n    {\n        name: \"#\",\n        type: \"string\"\n    }, {\n        name: \"title\",\n        type: \"string\"\n    }, {\n        name: \"author\",\n        type: \"string\"\n    }, {\n        name: \"published\",\n        type: \"string\",\n    }, {\n        name: \"url\",\n        type: \"custom\"\n    }];\n<\/pre>\n<h3 class=\"wp-block-heading\">2.3 TBody Component<\/h3>\n<p>This is the component where our data gets rendered, it takes help from another component down the hierarchy called the TRow. We will discuss this component next but the code for the TBody component looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>TBody.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">import React from 'react';\nimport TRow from '.\/TRow';\n\nfunction TBody(props) {\n    return &lt;tbody&gt;\n        {props.rows.map((row, ndx) =&gt; &lt;TRow rowIndex={ndx} \ntheme={props.theme} key={row.url} customRenderer={props.customRenderer} \ncolumns={props.columns} row={row}&gt;&lt;\/TRow&gt;)}\n    &lt;\/tbody&gt;;\n}\nexport default TBody;\n<\/pre>\n<p>This component iterates over the rows of data passed in using props and renders a TRow component per row of data. It also passes down the theme and the customRenderer for rows down to the TRow component that invokes them for individual rows.<\/p>\n<h3 class=\"wp-block-heading\">2.4 TRow Component<\/h3>\n<p>This is the final component in our component hierarchy and renders the individual rows in the tbody of our table. the code for this component looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>TRow.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">import React, { useState } from 'react';\n\nfunction TRow(props) {\n    const [hover, setHover] = useState(false);\n    const onHover = () =&gt; {\n        setHover(!hover);\n    }\n    return &lt;tr onMouseEnter={onHover} onMouseLeave={onHover}\n        style={hover ? { backgroundColor: \"#c0c0c0\" } : \nprops.rowIndex % 2 === 0 ? props.theme.rowEven : props.theme.rowOdd}&gt;\n        &lt;td key={0} style={props.theme.cell}&gt;{props.rowIndex + 1}&lt;\/td&gt;\n\n        {Object.keys(props.row).map((cell, ndx) =&gt; {\n\n            if (props.columns[ndx + 1].type === \"custom\") {\n                return &lt;td key={ndx + 1} \nstyle={props.theme.cell}&gt;{props.customRenderer(props.row)}&lt;\/td&gt;;\n            } else {\n                return &lt;td key={ndx + 1} \nstyle={props.theme.cell}&gt;{props.row[cell]}&lt;\/td&gt;;\n            }\n        })}\n    &lt;\/tr&gt;;\n}\nexport default TRow;\n<\/pre>\n<p>This component does a few things firstly it handles the mouse enter and mouse leave events of each row. And flips the hover flag on and off which enables us to highlight the row. Otherwise the row displays according to theme as a even row or odd row. This gives our table a striped look as we will see. This function component also makes use of state, yes function components can now have state, using React useState hook. One final note on this component, it calls the custom renderer on each row cell passing in the row. This is only for columns marked custom. We make use of this to render links to the articles as hyperlinks in the cell. <\/p>\n<p>The sample data passed into this component looks like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>SampleData.js<\/em><\/span><\/p>\n<pre class=\"brush: js\">export const sampleData = [\n    {\n        title: \"Bootstrap Autocomplete Example\",\n        author: \"Siddharth Seth\",\n        published: \"June 21st 2017\",\n        url: \"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-autocomplete-example\/\"\n    }, {\n        title: \"Bootstrap Calendar Example\",\n        author: \"Siddharth Seth\",\n        published: \"June 30th 2017\",\n        url: \"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-calendar-example\/\"\n    }, {\n        title: \"Bootstrap Thumbnails Example\",\n        author: \"Siddharth Seth\",\n        published: \"July 05th 2017\",\n        url: \"https:\/\/www.webcodegeeks.com\/css\/bootstrap\/bootstrap-thumbnails-example\/\"\n    }\n\u2026\n];\n<\/pre>\n<h2 class=\"wp-block-heading\">3. Styling<\/h2>\n<p>We use a JavaScript object to style our table. There is support for two themes a light one and a dark one. The styles for each component, viz., the table, rows, cells, columns are defined as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Table.Style.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">export const theme = {\n    light: {\n        column: {\n            backgroundColor: '#c0c0c0',\n            color: '#000',\n            border: '2px solid #f0f0f0'\n        },\n        rowEven: {\n            backgroundColor: '#e5e5e5',\n            color: '#010101'\n        },\n        rowOdd: {\n            backgroundColor: '#f0f0f0',\n            color: '#010101'\n        },\n        cell: {\n            textAlign: 'left',\n            fontSize: '.75rem',\n            padding: '5px'\n        },\n        table: {\n            border: '2px solid #f0f0f0',\n            borderCollapse: 'collapse'\n        },\n        button: {\n            display: 'inline-block',\n            color: '#010101',\n            backgroundColor: '#c0c0c0',\n            border: '2px solid #c0c0c0',\n            fontWeight: 'bold'\n        }\n    },\n    dark: {\n        column: {\n            backgroundColor: '#666',\n            color: 'whitesmoke',\n            border: '2px solid #666'\n        },\n        rowEven: {\n            backgroundColor: '#555',\n            color: '#ccc'\n        },\n        rowOdd: {\n            backgroundColor: '#666',\n            color: '#ccc'\n        },\n        cell: {\n            textAlign: 'left',\n            fontSize: '.75rem',\n            padding: '5px'\n        },\n        table: {\n            border: '2px solid #666',\n            borderCollapse: 'collapse'\n        },\n        button: {\n            display: 'inline-block',\n            color: '#ccc',\n            backgroundColor: '#888',\n            border: '2px solid #888',\n            fontWeight: 'bold'\n        }\n    }\n};\n<\/pre>\n<p>We add two buttons to the top of our Table with labels, Light and Dark. On click of either one we switch to the corresponding theme. To see this in action let us now run our application by executing the below on command line at the root of our application.<\/p>\n<pre class=\"brush: bash;\">&gt;npm start<\/pre>\n<p>Navigating to the URL http:\/\/localhost:3000 should show the below output.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"757\" height=\"784\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ReactTableOutput-1.jpg\" alt=\"\" class=\"wp-image-99010\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ReactTableOutput-1.jpg 757w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ReactTableOutput-1-290x300.jpg 290w\" sizes=\"(max-width: 757px) 100vw, 757px\" \/><figcaption>Project Output &#8212; Light Theme<\/figcaption><\/figure>\n<\/div>\n<p>Now on clicking the Dark theme button the table will switch themes and will display as below:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"741\" height=\"769\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ReactTableOutput-2.jpg\" alt=\"\" class=\"wp-image-99011\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ReactTableOutput-2.jpg 741w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/ReactTableOutput-2-289x300.jpg 289w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><figcaption>Project Output &#8212; Dark Theme<\/figcaption><\/figure>\n<\/div>\n<p>This wraps up our look at ReactJS Table Example. Hope this was helpful.<\/p>\n<h2 class=\"wp-block-heading\">4. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/10\/JCG-ReactJS-Table-Example.zip\"><strong>ReactJS Table Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article we will build a ReactJS Table Example. ReactJS has shot to fame and has become the front end library of choice. We look at how we can build a table with a set of components and keep it as flexible and configurable as possible. We will add features like styling and sorting &hellip;<\/p>\n","protected":false},"author":82952,"featured_media":92051,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1903],"tags":[],"class_list":["post-98802","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ReactJS Table Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Table!We look at how we can build a table with a set of components.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ReactJS Table Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Table!We look at how we can build a table with a set of components.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-08T04:00:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Seth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Seth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html\"},\"author\":{\"name\":\"Siddharth Seth\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/09c54717e2cc7956aa8a2df61330f18c\"},\"headline\":\"ReactJS Table Example\",\"datePublished\":\"2019-10-08T04:00:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html\"},\"wordCount\":1002,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"articleSection\":[\"React.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html\",\"name\":\"ReactJS Table Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"datePublished\":\"2019-10-08T04:00:23+00:00\",\"description\":\"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Table!We look at how we can build a table with a set of components.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/react-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/reactjs-table-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"React.js\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\\\/react-js\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"ReactJS Table Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/09c54717e2cc7956aa8a2df61330f18c\",\"name\":\"Siddharth Seth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"caption\":\"Siddharth Seth\"},\"description\":\"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/siddharth-seth-240180\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/siddharth_seth1980\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ReactJS Table Example - Java Code Geeks","description":"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Table!We look at how we can build a table with a set of components.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html","og_locale":"en_US","og_type":"article","og_title":"ReactJS Table Example - Java Code Geeks","og_description":"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Table!We look at how we can build a table with a set of components.","og_url":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-10-08T04:00:23+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","type":"image\/jpeg"}],"author":"Siddharth Seth","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Siddharth Seth","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html"},"author":{"name":"Siddharth Seth","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/09c54717e2cc7956aa8a2df61330f18c"},"headline":"ReactJS Table Example","datePublished":"2019-10-08T04:00:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html"},"wordCount":1002,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","articleSection":["React.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html","url":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html","name":"ReactJS Table Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","datePublished":"2019-10-08T04:00:23+00:00","description":"Interested to learn more about ReactJS? Then check out our detailed example on ReactJS Table!We look at how we can build a table with a set of components.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/reactjs-table-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/05\/react-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/reactjs-table-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.javacodegeeks.com\/category\/web-development"},{"@type":"ListItem","position":3,"name":"JavaScript","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript"},{"@type":"ListItem","position":4,"name":"React.js","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript\/react-js"},{"@type":"ListItem","position":5,"name":"ReactJS Table Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/09c54717e2cc7956aa8a2df61330f18c","name":"Siddharth Seth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","caption":"Siddharth Seth"},"description":"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.","sameAs":["https:\/\/www.linkedin.com\/in\/siddharth-seth-240180\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/siddharth_seth1980"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/98802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/82952"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=98802"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/98802\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/92051"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=98802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=98802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=98802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}