score:4
Accepted answer
you need something like this:
tablegenerator = () => {
return (
<table>
<tr>
{columns.map(column => <th>{column.data}</th>)}
</tr>
</table>
);
}
where column.data is the info you want to display (i used data as a general value but it could be label, name, info, etc).
Source: stackoverflow.com
Related Query
- React - Creating table using loop in class method
- componentDidMount method not triggered when using inherited ES6 react class
- Not able to add, update, delete rows in material table react using class based component. Previously it was working with functional component
- React table how to show 3 items each row using map loop
- Trying to use map method instead of for loop using React Typescript
- problem creating a reusable filtered table using React
- How do you render or not render table data based on conditions, using a loop in React JS?
- Creating a table in react using multiple component calls not working
- Using a method on a React class from a separate component
- Creating a PrivateRoute in React using Class component
- React ES6 class method does not render into html table but outside it. Why?
- For loop in react render method
- How to declare defaultProps on a React component class using TypeScript?
- Differences between creating a new class to using export const
- how to create common helper class in React JS using ES6 which is used by another component?
- "Missing return type on function" for every React class method
- Conditionally set active class on menu using react router current route
- fetch method is not defined using ES6 fetch in React
- React - How to iterate over dictionary in render method using JSX?
- Using ref with React Hooks in Ant design (antd) Table component with customized filters
- Something went wrong with react table using typescript
- Using ResizeObserver in React class component
- npm ERR! 401 Unauthorized: @babel/core@7.1.0 when using creating new react app
- How to provide dynamic className to element in React Class render method
- How to get a React Component reference to change its class using classList?
- What is the difference between arrow functions and regular functions inside React functional components (no longer using class components)?
- Mock setInterval method in react using jest test cases
- How do i call a method within another method in react class Es6
- How to test functions other than render in a React class using jest?
- Using instanceof to test for base class of a React component
More Query from same tag
- 404 Error when deploying React App on custom domain
- How to test Thunk actions with Jest and Sinon
- Does deep nesting flexbox layout cause performance issue?
- How to iterate the elements and based on certain condition update the entries an object in React Js
- How can I render component that gets rendered when clicking a button to the top of the list instead of the bottom?
- Get Rails Activerecord to use external API id for database
- Set state if the array exists
- How should be Redux State Anatomy?
- Check Input as its being typed ReactJS
- useState values where useContext.Provider is defined
- Javascript bubble sort to order a ranking table in Reactjs
- how to change background color of parent component dynamically from child component
- css grid + react component challenge
- onclick and function calling using reactjs
- How do I edit a task in a react/mysql application?
- Optional property based on value of enum
- React: is componentDidUpdate same for 2 different instances of a component?
- Chart.js not responsive
- react-stripe-elements not detecting Stripe.js
- onChange handler doesn't fire when using custom-component
- How to update the router state on history.replace in react router?
- Validation is not working with useState hook
- How to test if button was clicked?
- how to expand only one collapse panel in ant-design
- Getting props via state object
- img element is not working in Ionic React
- Cannot GET index.html Azure Linux Web App
- ReactJS: How to make <div/> float not affect the next <div/>?
- Browserify require imperavi redactor
- Render Different Component if All Components return Null in ReactJS