Regarding #2246. I'd say we should rewrite table, it's better not to use HTML table and instead do it all with div. This will give very flexible api and capability that would otherwise be impossible with table.
Right now there are tight couplings between Table and it's child components TableHeader, TableBody and TableFooter. There should be carefully designed props instead of wrapping the child components within divs and tables only to apply some styles and callbacks that can hurt composibility and customizability.
But I guess if we decide to do this we have to rewrite all the table components. Therefore, deprecation will be very hard.
Roadmap:
- Keep the
Table as it is for now.
- Create new
Table component set.
- Deprecate the old components with a migration guide.
- Remove the old
Table components after some time.
New Components to be built:
The sizes of columns will be passed down the hierarchy by the Table component. This information is something like this:
// the actual width of each column would be calculated like this:
// actualtWidthOfColumns[0] = (columns[0] / columns.sum() ) * tableWidth;
const columns = [5, 1, 1, 2, 2];
const tableWidth = 1000;
This means the first column will have the width of 500, the second 100 and so on.
With this, one can implement any feature around the table. Or even build it within the components. Features such as sorting, pagination, flexible columns, resizable columns, editable cells and so on. All these are possible right now, but with a lot of pain. Because the coupling is very tight. But with this things can become a lot easier for others to customize the table to their needs.
I'd love to hear everyone's thoughts on this. Or how it can be improved further.
Regarding #2246. I'd say we should rewrite table, it's better not to use HTML table and instead do it all with
div. This will give very flexible api and capability that would otherwise be impossible withtable.Right now there are tight couplings between
Tableand it's child componentsTableHeader,TableBodyandTableFooter. There should be carefully designed props instead of wrapping the child components withindivs andtables only to apply some styles and callbacks that can hurt composibility and customizability.But I guess if we decide to do this we have to rewrite all the table components. Therefore, deprecation will be very hard.
Roadmap:
Tableas it is for now.Tablecomponent set.Tablecomponents after some time.New Components to be built:
The sizes of columns will be passed down the hierarchy by the
Tablecomponent. This information is something like this:This means the first column will have the width of 500, the second 100 and so on.
With this, one can implement any feature around the table. Or even build it within the components. Features such as sorting, pagination, flexible columns, resizable columns, editable cells and so on. All these are possible right now, but with a lot of pain. Because the coupling is very tight. But with this things can become a lot easier for others to customize the table to their needs.
I'd love to hear everyone's thoughts on this. Or how it can be improved further.