I'm trying to render a very simple table with React and the Blueprint UI toolkit.
The documentation relative to the Table
component is quite simple, but it seems like my code doesn't work.
import React from 'react';
import ReactDOM from 'react-dom';
import * as Blueprint from '@blueprintjs/core';
import { Cell, Column, Table } from '@blueprintjs/table';
const renderCell = (rowIndex: number) => {
return <Cell>{`$${(rowIndex * 10).toFixed(2)}`}</Cell>
};
var myTable = (
<Table numRows={10}>
<Column name="Dollars" renderCell={renderCell}/>
</Table>
);
ReactDOM.render(
myTable,
document.getElementById('myTable')
);
The image below shows what I get. How do I fix it?