({ rowData, rowIndex, cells, columns })
| 6 | columns[spanIndex].align = Column.Alignment.CENTER |
| 7 | |
| 8 | const rowRenderer = ({ rowData, rowIndex, cells, columns }) => { |
| 9 | const span = columns[spanIndex].colSpan({ rowData, rowIndex }) |
| 10 | if (span > 1) { |
| 11 | let width = cells[spanIndex].props.style.width |
| 12 | for (let i = 1; i < span; i++) { |
| 13 | width += cells[spanIndex + i].props.style.width |
| 14 | cells[spanIndex + i] = null |
| 15 | } |
| 16 | const style = { |
| 17 | ...cells[spanIndex].props.style, |
| 18 | width, |
| 19 | backgroundColor: 'lightgray', |
| 20 | } |
| 21 | cells[spanIndex] = React.cloneElement(cells[spanIndex], { style }) |
| 22 | } |
| 23 | return cells |
| 24 | } |
| 25 | |
| 26 | export default () => ( |
| 27 | <Table fixed columns={columns} data={data} rowRenderer={rowRenderer} /> |
no outgoing calls
no test coverage detected