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 4082212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:09:35+00:00 2026-05-20T18:09:35+00:00

I have a link to a potentially large table of data: <a class=tabledata href=table.php>View

  • 0

I have a link to a potentially large table of data:

<a class="tabledata" href="table.php">View data</a>

In the head of the page I load jQuery and FancyBox and then use the following to pull just the table fragment from the dummy HTML page:

$("a.tabledata").fancybox({
    'type': 'ajax',
    'ajax': { 
        dataFilter: function(data){
            return $(data).find('table');
        }
     }
});

In table.php I have a large table of data. Below is the unstyled dummy I’ve been using to try and debug this issue:

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Dummy table</title>
</head>
<body>
  <div id="transactions" class="panel">
    <h4>Transactions</h4>
    <table class="data_list">
      <tr>
        <th>ID</th><th>Row class</th><th>Hash</th>
      </tr>
<?php
$c = 0;
while ( $c < 100 ) : ?>
      <tr class="<?php echo ( $c++ % 2 == 1 ) ? 'odd' : 'even'; ?>">
        <td><?php echo $c; ?></td>
        <td><?php echo ( $c % 2 == 1 ) ? 'odd' : 'even'; ?></td>
        <td><?php echo md5( $c ); ?></td>
      </tr>
<?php endwhile; ?>
    </table>
  </div>
</body>
</html>

Small tables are displayed perfectly.

If I load the large table as a FancyBox iFrame, it’s positioned correctly within the browser window, and there is a scrollbar on the right.

If I load the large table through FancyBox AJAX (which I need to do in order to isolate the required page fragment), the FancyBox modal extends way beyond the bottom of the browser window — even beyond the background overlay.

How can I force AJAX FancyBox modals to size themselves correctly?

  • 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-05-20T18:09:35+00:00Added an answer on May 20, 2026 at 6:09 pm

    You can force the size of the fancybox:

    $.fancybox(
        '<p>BOX CONTENT</p>',
        {
            'autoDimensions'    : false,
            'width'             : 800,
            'height'            : 600,
            'scrolling'        : 'yes' //or auto depending on preference
        }
    );
    

    I assume that forcing the size to “smaller” than the content will activate a scroll method. Check the Fancybox Docs on this issue.

    Given your example:

    $("a.tabledata").fancybox({
        'type': 'ajax',
        'ajax': { 
                    dataFilter: function(data){
                        return $(data).find('table');
                    }
                },
        'width':800,
        'height':600,
        'autoDimensions':false,
        'scrolling':'yes' //or auto depending on preference
    });
    

    autoDimensions defaults to true and resizes the modal box to fit the content, if the content is massive and goes off the page, the modal box will fit it and thus go off the page. Setting the height and width of the box and then disabling autoDimensions will allow the sizing to work.

    Update:

    I’ve just had another idea. If you wrap the table in the html with a div and style the div to specific dimensions with overflow:auto then call the div into the ajax instead of the table, it should work.

    There are many examples here: http://fancybox.net/blog

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with a Print link that takes the user to a
I have a servlet that allows users to download (potentially large) zip files from
I have the following Rails link generating code (I have removed potentially 'industry secret'
I have a link that I dynamically create which looks something like the following:
Anyone have a link to what the C++ standard says regarding a compiler removing
I have a link in a pdf-document (PDF1), which is embedded in a browser
I've seen (and used) code to have a link spawn a javascript action many
Does anyone know, or have a link to an article or a step by
I have seen this link: Implementing Mutual Exclusion in JavaScript . On the other
I have established a link using Netbeans and Paradox driver and can query the

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.