diff --git a/ui/src/components/table-new/story.js b/ui/src/components/table-new/story.js index 9555e22e..2e128b6a 100644 --- a/ui/src/components/table-new/story.js +++ b/ui/src/components/table-new/story.js @@ -42,6 +42,11 @@ const data = [{ status: 'Active', role: 'Owner', key: 1 +}, { + name: 'Alex', + status: 'Inactive', + role: 'Read Only', + key: 2 }]; storiesOf('Table New', module) diff --git a/ui/src/components/table-new/table-head.js b/ui/src/components/table-new/table-head.js index 1faf44bc..7bdc2531 100644 --- a/ui/src/components/table-new/table-head.js +++ b/ui/src/components/table-new/table-head.js @@ -2,16 +2,16 @@ // const composers = require('../../shared/composers'); const React = require('react'); -// const Styled = require('styled-components'); +const Styled = require('styled-components'); // const { // remcalc // } = fns; -// const { -// default: styled, -// css -// } = Styled; +const { + default: styled, + // css +} = Styled; // const { // clearfix @@ -36,17 +36,39 @@ const React = require('react'); // } // `; -const TableHeader = (columns) => { +const StyledTableHeadItem = styled.td` + ${props => `width: ${props.width}`} +`; + +const TableHeader = ({ + columns +}) => { + + const fallBackWidth = `${100 / parseInt(columns.length)}%`; + + const titles = columns.map( (column, i) => { - columns.map( (column, i) => { return ( -