GithubHelp home page GithubHelp logo

max-height support about fixed-header-table HOT 3 OPEN

markmalek avatar markmalek commented on July 25, 2024
max-height support

from fixed-header-table.

Comments (3)

buste avatar buste commented on July 25, 2024

+1

from fixed-header-table.

marianopeck avatar marianopeck commented on July 25, 2024

I am having this same problem. And what is worst is that if you need an horizontal scroll bar, and the table container is smaller than the specified height then the scroll bar appears way on the bottom....after a lot of empty space :(

from fixed-header-table.

marianopeck avatar marianopeck commented on July 25, 2024

In my case the problem was the following. I have lots of tables (reports), say 20 different tables. Yet, I use the same code for displaying them. Of course, at some point, I need a number to represent the hight for such tables, but I cannot made the too big and scroll because I may have several records. So say at some point I sadi: 'OK, height should be not more than 900px'. Perfect. But if I simply pass that value to the fixed table, it will use it as 'height' and I would use all the space. Sometimes, some of my tables may not that much rows, and hence, the space used by the table is less than 900px. Say it was 400px. So first, it is ugly that it uses 900px because 500px looks like empty. Second, what was worst in my case, for horizontal scrolls, they appear JUST AFTER the 900x ...quite far from there the table finished in this case (400px)...

So the way I solved it is to have my own div (tableContainer) and inside that div, the table. And then, add this css:

 .tableContainer {
max-height: 900px;
 }

 .fht-table-wrapper { 
max-height: 900px;
   }

But..I wanted to set this 900px from javascript, because I wanted to calculate that as an approx. 80% of the height of the browser window. So now before calling the javascript table I do:

    $(".tableContainer").css("max-height", (($(window).height()*0.8) +''px'') );
    $(".fht-table-wrapper").css("max-height", (($(window).height()*0.8) +''px'') );

But...I didn't work right ahead. I had to add a "max-height: inherit; " to the defaultTheme.css:

   .fht-table-wrapper,
 .fht-table-wrapper .fht-thead,
 .fht-table-wrapper .fht-tfoot,
 .fht-table-wrapper .fht-fixed-column .fht-tbody,
 .fht-table-wrapper .fht-fixed-body .fht-tbody,
  .fht-table-wrapper .fht-tbody {

max-height: inherit;    
.....

}

and there it worked as I expected.

from fixed-header-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.