Questions tagged [angular-material-table]

The Material Data Table component is a generic component for displaying tabulated data.

Useful Links:

https://blog.angular-university.io/angular-material-data-table/

https://material.angular.io/cdk/table/overview

https://material.angular.io/cdk/table/api

240 questions
14
votes
4 answers

Include Buttons and Paginator in the Material Table Footer

I use Angular Material Table and I need a command button and the table's paginator in the table's footer row, something like this My code is like this actually
serge
  • 9,891
  • 17
  • 84
  • 142
12
votes
1 answer

How to add mutiple header rows using angular material table

Parameter 1: Time Period {{element.value}} Parameter 2: Gender {{element.gender}} Patients with Base Condition…
v3nu
  • 125
  • 1
  • 9
10
votes
4 answers

mat-paginator breaks when mat-table is inside of NgIf

I have an angular project that is using mat-table and mat-paginator for a certain view, the problem is the view has a grid view and table view with a toggle, the grid view is default and table is hidden using an NgIf when the grid view is active. …
9
votes
1 answer

Angular Material Table how to pass object to displayedColumns instead of array

I am building a table in Angular8 with Material table. I am using an array of strings to define the displayedColumns and passing in each array value to the matColumnDef directive. This is working properly. TS displayedColumns: any[] = ['username',…
pengz
  • 1,673
  • 1
  • 32
  • 64
8
votes
3 answers

Why am I unable to apply a border to an angular mat-table row?

I have a simple angular material table:
Name {{element.name}}…
Rob
  • 551
  • 2
  • 5
  • 16
8
votes
1 answer

Angular material 2 table - define column using TemplateRef and ngTemplateOutlet

I am trying to make reusable material table and I want to use TemplateRef with ngTemplateOutlet to generate columns. In this example I created cards components which is using my material-table component. In cards.component.html I have template of…
tprieboj
  • 1,437
  • 2
  • 26
  • 44
7
votes
1 answer

How to use key-value object as datasource for Angular Material table

I have an API response that looks like this: { "2019-02-13": { "costs": 117, "commission": 271.07 }, "2019-02-14": { "costs": 123, "commission": 160.37 }, //etc.. } I want to use this object as a datasource for my material…
7
votes
1 answer

Angular show image in Material Table Cell

I try to show an image in a cell of my Material table. Therefore I tried this code in my HTML File: imageUrl
Dominik
  • 103
  • 1
  • 1
  • 6
5
votes
1 answer

MatTable Expand Collapse Icon issue on pagination and sort

I've a angular material table which uses detailRow directive to insert a detail/sibling adjacent row to a table row. StackBlitz I wanted to give it an appearance of as if the row is being expanded or collapsed, so I added couple of icons to it which…
5
votes
4 answers

Angular Material Table Cell Formatting

I'm using angular material table for displaying data and dyanmically binding the table header and table data. Is there any way to format particaular column's cell content dynamically?. For example how can i format the value of amount column right…
Tom
  • 51
  • 1
  • 1
  • 2
4
votes
3 answers

How do I verify I've selected the correct user from a table in Cypress (html-table / angular-material)

I'm trying to delete a specific user, and would rather the test fail then delete a different user if the user I want doesn't exist. The issue, I can't seem to find a way to verify the checkbox is next to the user I want. I've been using a .each()…
4
votes
0 answers

ERROR TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable in Angular 8

I am using mat sort to sort mat-table in angular 8. Getting error "You provided 'undefined' where a stream was expected" when using following code. ngAfterViewInit() { this.dataSource.sort = this.sort } Please find below full source code: html…
tsummo
  • 41
  • 3
4
votes
2 answers

Angular Mat-Table finished rendering Event / Mat Paginator Loading Spinner

I am using an Angular Material Table with a rather big, pre queried Datasource. Now, everytime i change the Table Pages with the built in Paginator, i have a short Delay before the new Table-Rows are rendered and i would like to display a Loading…
4
votes
2 answers

Angular mat-table: Is it possible to merge cells by columns?

I'm having trouble finding an answer on how to merge columns cells in mat-table. Only saw few examples in merging row cells using when. So was wondering if i can find answers here. I have this JSON data: { "id": 4, "description": "this is…
4
votes
1 answer

How to use 2 pagination for single table in angular material table?

I am creating an application in angular6 with angular material. How to use 2 pagination in a single table. I want to show pagination both places Header and Footer. The header pagination only shows the "Items per page" with drop-down. The footer…
imjayabal
  • 527
  • 1
  • 5
  • 20
1
2 3
15 16