Bug
if cells has static width, scrolling appears and all content inside should have same styles.
if cells has static width, scrolling appears and all content that out of view has no correct styles.
view: https://angular-g5gfng-yw7aey.stackblitz.io/
editor: https://stackblitz.com/edit/angular-g5gfng-yw7aey
Just scroll horizontally and you'll see that styles are broken.
I'm using app where i need dynamically change displayed columns, so when i show all columns on mobile this issue appears
angular: 5+,
material: 5+,
os: windows, ios
browser: chrome, IE11 - EDGE
TypeScript: doesn't matter
nope
Thank you
.example-container {
display: flex;
flex-direction: column;
width: 200px;
overflow: auto; /*<-*/
}
.example-table {
flex: 1 1 auto;
/* overflow: auto; */ /*<-*/
max-height: 500px;
display: table; /*<-*/
}
@andrewseguin Hello, any updates about this issue ?
@todoubaba Thanks. It works. The key for my table was display:table !important on the .mat-table, and a separate container for overflow: auto;
Column width for my app was limited as such:
.mat-header-cell, > .mat-cell {
padding: 0 5px;
min-width: 100px;
}
Now, I have dynamic columns that do not break styling when overflow scrolling.
@kamok i did exactly what you did. but adding display: table breaks the scroll and display all the content.
and also don't see the table line rendered correctly.
could you share a working complete code? thank you
@djleonskennedy hi, any chance you have fixed the issue in your plunker?
Fixed in #10594 - Use native <table> for a better styling experience
@andrewseguin is there an example using the <table>? how is 'datasource' used?
Same way as before. Check out these revised docs for help: https://github.com/angular/material2/blob/master/src/lib/table/table.md
Essentially, you will now write <table mat-table [dataSource]="myDataSource"> instead of <mat-table [dataSource]="myDataSource">
using the
Most helpful comment