4 ms·
does it have merged cells? we've had to in-house tables for this alone
by nullorundefined 7y ago
does it have merged cells? we've had to in-house tables for this alone
- tannerlinsley 7y agoA plugin is currently in development to make this extremely easy and turn-key, but for now (since you control the rendering layer), you can do this on your own with a few lines of code in your table renderer.
- tannerlinsley 7y agoDM me on twitter and we can discuss more there. @tannerlinsley
- quink 7y agoWhat I did to merge cells but keep the headers the same was to just suppress rendering via if (isFakeColumn(cell.column.id)) { return <React.Fragment key={cell.column.id}></React.Fragment>; } And then render it with another column: {cell.column.id === "title" ? ( <> {cell.render("Cell")} <br /> {row.cells[2].render("Cell")} <br /> {row.cells[3].render("Cell")} {" · "} {row.cells[4].render("Cell")} </> ) : ( cell.render("Cell") )} There's probably a way to get at the lot via a string, but by index was quick and easy enough. One thing I do have to complain about is the lack of native TypeScript support - there used to be types in the repo, but they got removed. And `prepareRow(row)` is a bit ugly, but nothing major and it's only a one-time call.
- tannerlinsley 7y agoYeah, I'm sorry that's the case now. Having the types as first-class citizens of the repo while the library was not written in TS or maintained by TS devs was a big mistake. They are still available (and will updated asap from some other great devs) in DT. The prepareRow function may be ugly, but not as ugly as a freakishly slow table with only a handful of rows and columns visible at once ;)