Skip to content

[Table] Possibility to add html in between table rows ? #5936

@Lakston

Description

@Lakston

Bug, feature request, or proposal:

More of a question if this is possible or not.

What is the expected behavior?

I would like to be able to add markup below each row so I can show it conditionally on row click so it would behave like an accordion. Additional infos would be contained in a div with an ngIf and triggered on row click.

To illustrate what I am trying to achieve :

| Firstname | Lastname | email |
| <div *ngIf="row is clicked">Additional Content</div> |
| Firstname | Lastname | email |
| <div *ngIf="row is clicked">Additional Content</div> |

What is the current behavior?

The cdk docs states Any content placed inside of the header row or data row template will be ignored, as the rendered content of the row comes from the cell templates described above. so it seems that what I'm trying to achieve is not possible.

What are the steps to reproduce?

As stated in the docs any attempt to add markup between the md-row tags will be ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions