aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/TableBox.tsx
blob: dfa8262d88b7bd317083ebb85e92ae296e1a1d20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { action, computed, observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";

interface TableBoxProps {
    pairs: {x: number, y:number}[]
}


export class TableBox extends React.Component<TableBoxProps> {



    render() {
        return (
            <div className="table-container">
                <table className="table">
                    <thead>
                        <tr className="table-row">
                            <th>x</th>
                            <th>y</th>
                        </tr>
                    </thead>
                    <tbody>
                    {this.props.pairs.map(p => {
                        return (<tr className="table-row">
                            <td>{p.x}</td>
                            <td>{p.y}</td>
                        </tr>)
                    })}
                    </tbody>
                </table>
            </div>
        )
    }

}