import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Data from './data.js';
import './css/Table2-style.css';

function createReactTable(data,root1){
  class Table2 extends Component {
    render() {
      return(
          <table className='Table2'>
            <tbody>
              {
                Data.map((item,i)=>{
                  return <tr key={i}>
                    {
                      Data.map((item,i2)=>{
                        return <td key={i2}>{Data[i][i2]}</td>
                      })
                    }
                  </tr>
                })
              }
            </tbody>
          </table>
      )
    }
  }
  ReactDOM.render(
    <Table2/>,
    root1
  )
}
createReactTable(Data, document.getElementById('root2'));
