ngx-datatable
ngx-datatable copied to clipboard
Rowspan and Colspan
I checked all documentation for ngx-datatable.
Can someone show me how to to do it or help me to build table with rowspan and colspan
Thanks in advanced Vishal
I think there is now possibility to do that. One column header is for one row column. Coincidentally I would open right now a feature request to have the possibility to group columns and set and grouping header for the columns. Something like the screenshot here
I think this would fit with the pinning functionality?
@vishd is that fitting with your request?
Row/Column spanning is not supported. I do not have any plans to support it right now but open to provide feedback if you wish to embark on that.
(background: my project needs the multi-column header @mburger81 mentioned)
@amcdnl can you provide some guidance for would-be contributors?
- Have you thought about an interface for (1) multi-column header or (2) for generic colspan/rowspan?
- Is (1) significantly easier than (2)?
- Do you foresee any architectural roadblocks (for (1) or (2)) on the contrary do you see the piece of code we should start looking that?
- I have not, perhaps some type of attr on the column / rows you describe on the input of the table.
- I don't think one would be easier would be easier than the other.
- I do not
As you implement, please keep us in the loop and I can help :)
@eddy-geek was you you able to implemented this feature? Or are there any progress on this feature?
@eddy-geek Any progress on this?
Any updates?
@mburger81 @tscislo, no, IIRC we've used a crappy workaround instead.
I think a simple function passed to the TableColumn
like span: number | ((row) => number)
could be used to enable this. If the property is ever changed, then the view is refreshed, otherwise a cache is kept along with the cache of expanded rows, and not refreshed till the property is updated. CSS could be used to combine borders, etc.
Oh, and as for the cache, I think a combined row/column index dictionary approach would be suitable, something that can take a row and column's index and return a boolean, which simply means skip over that cell cause it's part of a span.
Update Instead of returning a boolean, it could return some cell context containing more data such as cell width
I hope to have this feature too
+1
I have achieved this using [columnMode]="'flex'" and the ngx-datatable-cell-template directive. For example you have a column that you need to be colspan=3.. Add to this cell [flexGrow]="3" and to the other cells [flexGrow]="1"
How to merge cells vertically (rowspan)?
@ErvinLlojku how did you achieve this? apparently ngx-datatable-cell-template
directive doesn't have a property flexGrow
— at least it's what the browser console is telling me.
+1 how can I perform rowspan?
I Tried All Of this step Above But I Didnt Get Any time of solution
+1
+1
+1
+1
+1
+1
+1