Answers for "react hooks receive sql td hearder"

SQL
0

react hooks receive sql td hearder

import React from "react";

const Table = ({ headers, data }) => {
  return (
    <div>
      <table>
        <thead>
          <tr>
            {headers.map(head => (
              <th>{head}</th>
            ))}
          </tr>
        </thead>
        <tbody>
          {data.map(row => (
            <tr>
              {headers.map(head => (
                <td>{row[head]}</td>
              ))}
            </tr>
          ))}
        </tbody>
      </table>
    </div>
  );
};

export default Table;
Posted by: Guest on October-12-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language