Open samyomar opened 9 years ago
Maybe this can be achieved using just css?
A quick look on SO:
@christianacca For vertical scrolling, it would be an easy fix with CSS using overflow-y: auto;
on the tbody
. For horizontal scrolling on the other hand, is it a whole different story.
For horizontal scrolling, you cannot do it with pure CSS, from what I know. The problem is that the columns in the thead
would not scroll along with the columns in tbody
. To solve that, I've seen some jQuery plugins that brake the table into two separate tables, one containing the thead
and one containing tbody
and then they scroll both tables simultaneously using javascript.
@c-eliasson - I'm having some trouble with your suggestion, the table headers are still scrolling even with that style applied to the body. Any chance you've got an example I can look at?
@RohitUdayTalwalkar You would probably have to set display: block;
on the tbody
as well.
@c-eliasson https://github.com/c-eliasson Great, that works! The width doesn't match the header but I think I can write a directive to get that working.
Thanks for the quick response!
-Rohit
On Mon, Mar 9, 2015 at 1:46 PM, Christofer Eliasson < notifications@github.com> wrote:
@RohitUdayTalwalkar https://github.com/RohitUdayTalwalkar You would probably have to set display: block; on the tbody as well.
Example https://jsfiddle.net/6wsds9rn/
— Reply to this email directly or view it on GitHub https://github.com/esvit/ng-table/issues/524#issuecomment-77938524.
One can be inspired by this SO question and perhaps by one of those github projects:
the ability to add fixed header will be very good