daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 519 forks source link

Text-Wrap and restrict column header width #462

Closed panickerr closed 8 years ago

panickerr commented 8 years ago

Hi Guys, Is there a way to restrict the width of the individual columns in the header so that i can split lengthy column names into separate lines ?

BR

daniel-nagy commented 8 years ago

Try using

th.md-column {
  white-space: normal;
}
panickerr commented 8 years ago

@daniel-nagy thanks man. But it works only when i embed that in style within the tag and fails to work when i use it was a class outside and call it.

daniel-nagy commented 8 years ago

You'll need to use a more specific selector to overwrite the default style

// this is the default
table.md-table th.md-column {
  white-space: nowrap;
}

Or use !important.

panickerr commented 8 years ago

Hey its working nicely thanks :+1: