question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scrolling table with fixed headers

See original GitHub issue

Something like this: http://www.imaputz.com/cssStuff/bigFourVersion.html

I’ve looked at a lot of different discussions about how to accomplish this, either through plug-ins or using CSS, but so far nothing I’ve found has worked quite how I would like it. My primary problem with the CSS approach is that having to apply the display: block; property breaks the formatting of the table, making it look ugly and unable to resize with the window. Is this a feature you’ve ever considered adding to ng-table? If not, do you know of the best way I can achieve this?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:31 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
theaspectcommented, Oct 13, 2016

Whoever find this, use https://github.com/jmosbech/StickyTableHeaders works out of the box with this directive:

.directive "stickyHeader", ["$timeout", ($timeout)->
  restrict: 'A'
  link: (scope, element, attrs) ->
    $timeout(() -> $(element).stickyTableHeaders())
]
0reactions
chrispyliangcommented, Jun 20, 2018

here is an approach with pure css

tbody {
    max-height: 200px; 
    overflow-y: scroll;
    display: block;
}

thead, tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create a Table with a Fixed Header and Scrollable ...
In this tutorial, find some methods of creating an HTML table with a fixed header and scrollable body. Here, we suggest using some...
Read more >
How to create a table with fixed header and scrollable body
The purpose of this article is to create a table with a fixed header and scrollable body. We can create such a table...
Read more >
Table fixed header and scrollable body - Stack Overflow
I am trying to make a table with fixed header and a scrollable content using the bootstrap 3 table. Unfortunately the solutions I...
Read more >
Fixed Table Headers - Adrian Roselli
Regardless, you should ensure the column header for the row headers does not disappear when scrolling left-right. The easiest way to do that...
Read more >
Making Tables With Sticky Header and Footers Got a Bit ...
It wasn't long ago when I looked at sticky headers and footers in HTML s in the blog post A table with both...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found