Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9074193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:34:49+00:00 2026-06-16T18:34:49+00:00

I have multiple tabs in my application with multiple datatables. I am trying to

  • 0

I have multiple tabs in my application with multiple datatables.

I am trying to figure out a way to adjust the height of datatables based on the screen size.

I tried the below function, but it doesnt seem to increase the height of datatable when the window is resized. Any suggestions would be very helpful?

  var calcDataTableHeight = function(percentageValue) {
             return $(window).height()*(percentageValue)/100;
         };



$(window).resize(function() {
          var table = $.fn.dataTable.fnTables(true);
                if ( table.length > 0 ) {
                    for(var i=0;i<table.length;i++){
                        $(table[i]).dataTable().css({ height: $(table[i]).dataTable().parent().height() });
                        $(table[i]).dataTable().fnAdjustColumnSizing();  
                    }
                }
                }
     });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:34:50+00:00Added an answer on June 16, 2026 at 6:34 pm

    I figured out a way to increase the height using scrollY parameter..sample snippet below…

    $(window).resize(function() {
        var table = $.fn.dataTable.fnTables(true);
        if (table.length > 0) {
            for(var i = 0; i < table.length; i++) {
                $(table[i]).dataTable().fnSettings().oScroll.sY = 
                    $(window).height() < 650 ? calcDataTableHeight(40) : calcDataTableHeight(54);
                $(table[i]).dataTable().fnAdjustColumnSizing();  
            }
        }
    });
    
    function calcDataTableHeight(percentageValue) {
        return $(window).height()*(percentageValue)/100;
    }; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application, I have multiple tabs. In one of the tabs, I have
I have a tab control in my WPF application with multiple tabs. Each tab
I have an application with multiple documents opened at once (as different tabs), but
I have a flex application in which I have a TabNavigator with multiple tabs
I want to have a GUI application which would contain multiple tabs, each with
I have a Silverlight 4 application that uses multiple tabs. On Tab 1 I
In my application,I have four tabs at the bottom.Each tab has multiple activities.In order
In the application we have a wizard with multiple tabs. On the first tab
I have a page with multiple tabs. But if you copy/paste the code and
I have a set of Excel spreadsheets with multiple tabs which contains each one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.