Request, creating a request as suggested in ticket #10594 by @CDDelta
Not able to implement rowspan attribute for cdk table. would be great if any example is present on material.angular.io.
No example is present for rowspan attribute for cdk table.
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
C
All
expected example:

Thanks, will add this to the queue of things to change in the docs.
Thanks a lot @andrewseguin. for us its a blocker couldn't able to move ahead because of this. If I get some stackblitz example then that would be great.
Thanks in advance.
Here's a reproduction of your expected result: https://stackblitz.com/edit/angular-lnahlh?file=app%2Ftable-basic-example.css
Thank you a lot @andrewseguin. This is crazy.
@andrewseguin Can this be applied on header rows? I want to do something like this http://prntscr.com/k725va
@andrewseguin appreciate the sample, but I don't think this would work for more complicated tables that use pagination, filtering, etc?
edit: Here's the example modified to use pagination. It does not work.
I ended up manually figuring out the rowspans based on the current filters and page size. The basic idea is to update an array of rowSpans every time the filter or pagination changes:
````
updateRowSpans(){
this.rowSpans = [];
let renderedRowData = this.tableData.filteredData.slice(this.paginator.pageIndex * this.paginator.pageSize, (this.paginator.pageIndex + 1) * this.paginator.pageSize)
let indexOfFirstRow: Map
renderedRowData.forEach((row: MyRowObject, index) => {
if(indexOfFirstRow.get(row.propertyIWantToSpan.id) === undefined){
//if this is the first one, set the first row so we can increment it later
indexOfFirstRow.set(row.propertyIWantToSpan.id, index);
this.rowSpans[index] = 1;
}else{
//otherwise, increment the span of the first row and set this one to 0
this.rowSpans[indexOfFirstRow.get(row.propertyIWantToSpan.id)]++;
this.rowSpans[index] = 0;
}
});
}
````
and then
````
````
It'd be cool if something like this could be built into material at some point.
Here's a reproduction of your expected result: https://stackblitz.com/edit/angular-lnahlh?file=app%2Ftable-basic-example.css
Would it be possible to turn this into a directive?
Like:
<ng-container matColumnDef="testTime">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell **shouldRowSpan** *matCellDef="let data; let i=index"></td>
</ng-container>
And the directive will automatically subscribe himself to a service that handles it.
Essentially, if mat-cell[i] and mat-cell[i+1] have the same content, then give mat-cell[i] rowspan="2", and mat-cell[i+1] display:none; , exactly like in the stackblitz.
Most helpful comment
Here's a reproduction of your expected result: https://stackblitz.com/edit/angular-lnahlh?file=app%2Ftable-basic-example.css