-
Hey, Here's my current solution: <Table data={tableData} theme={theme} layout={{ custom: true }}>
{(tableList) => (
<>
<Header>
<HeaderRow>
<HeaderCell style={{ width: "50px" }}>ID</HeaderCell>
<HeaderCel style={{ width: "100px" }}l>Name</HeaderCell>
</HeaderRow>
</Header>
<Body>
{tableList.map((item) => (
<Row onClick={onRowClicked} key={item.id} item={item}>
{(tableItem) => (
<>
<Cell style={{ width: "50px" }}>{tableItem.id}</Cell>
<Cell style={{ width: "100px" }}>{tableItem.name}</Cell>
</>
)}
</Row>
))}
</Body>
</>
)}
</Table> The issue is, I have to set it at HeaderCells and at RowCells. Is there another possibility that i overlooked? What do you recommend? const columnWidths = `
&:nth-child(1) {
width: 30%;
}
&:nth-child(2) {
width: 90%;
}
`;
...
BaseCell: `
border-right: 1px solid #e3e4e5;
${columWidths}
`,
... Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
For the project we are using this table for, we agreed on creating custom themes for every table variation, even if it's only for the layout. The layout feature was implemented very quickly, that's why I used the theming capabilities that were already provided by the library. It also had to work with the resize feature, which was given when using the custom theme. Let me know if you would want to explore any other way of introducing layouts. |
Beta Was this translation helpful? Give feedback.
For the project we are using this table for, we agreed on creating custom themes for every table variation, even if it's only for the layout.
The layout feature was implemented very quickly, that's why I used the theming capabilities that were already provided by the library. It also had to work with the resize feature, which was given when using the custom theme.
Let me know if you would want to explore any other way of introducing layouts.