react 渲染table数据

表格效果如图所示:

react 渲染table数据_第1张图片

const headers=['bookName','Author','Language','Published','Sales'];
const data=[
  ['Tfd rod','J.F','English','1954-1955','150milion'],
  ['Td rod','E.A','English','1904-1965','250milion'],
  ['Tsc rod','S.F','English','1944-1987','550milion'],
  ['Tfg rod','J.O','English','1923-1951','190milion'],
  ['Txfe rod','U.P','English','1914-1947','230milion']
];
class Excel extends React.Component{

  render(){
    return (
     
{ this.props.headers.map((head,index)=> ) } { this.props.data.map((row,index)=>{ return ( { row.map((cell,index)=>{ return }) } ) }) }
{head}
{cell}
); } } ReactDOM.render(
, document.getElementById('app') );


你可能感兴趣的:(React)