react-mdl icon indicating copy to clipboard operation
react-mdl copied to clipboard

[DataTable] Fixed header with scrollable content

Open koutsenko opened this issue 9 years ago • 1 comments

Is there any way to implement this? Something like a "scrollable" and "fixedHeader" properties. Thanks.

koutsenko avatar Nov 29 '16 04:11 koutsenko

I tried to do something like that - wrap DataTable to div with className 'scrollabletable'. It works but is very dirty solution, it assumes that table header is 5em height and so on...

.scrollabletable {
  overflow-y: scroll;
  height: 100%;
  margin-top: 5em;
}

.scrollabletable > table {
  top: -5em;
}

.scrollabletable > table > thead {
  position: fixed;
  z-index: 50000;
  background: white;
  outline: 1px solid white;
}

.scrollabletable > table > tbody {
  position: absolute;
  margin-top: 5em;
}

Maybe somebody can test and improve this solution.

koutsenko avatar Dec 01 '16 11:12 koutsenko