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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:31:40+00:00 2026-06-12T01:31:40+00:00

EDIT: SOLVED. When the page originally loads the datatable is formed using the css

  • 0

EDIT: SOLVED. When the page originally loads the datatable is formed using the css files as laid out. However when it was calling the javscript it was rebuilding the datatable and ignoring any CSS files I had referenced. As such it was automatically shrinking the table to match the size of the text. This was avoided by setting bAutoWidth = false in the actual creation of the datatable.

Thanks to everyone who helped!.

so I have a datatable as follows.

   <div class="datatable" style="display:none;">
            <div class="row">
                <table class="display" id="testtable">
                    <thead>
                        <tr>
                            <th>First column</th>
                            <th>Second</th>
                            <th>Third</th>
                        </tr>
                    </thead>
                    <tbody id="selectable">                           
                                <tr class="gradeU">
                                    <td align="left">First column info</td>
                                    <td align="left">second</td>
                                    <td>Third</td>
                                </tr>
                    </tbody>
                </table>

            </div>
        </div>

So the above is the datatable, as you can see the table itself is hidden as I only want to show it when a user hovers over a button. When the user hovers over the button the following code is called from a function.

   $(".datatable").show();

This works, however it breaks the CSS. The datatable becomes very squashed and is only about one quarter the width it should be. I have tried setting the width to be bigger in the function that is called however no luck. I know it has something to do with the following code

     style="display:none;"

as once I take this out the table displays fine however I need it hidden until the function is called.

I have tried the usual $(element).style.visibilty but nothing seems to make a difference, the table stubbornly refuses to go to its correct size. Any help is greatly appreciated and thanks in advance.

EDIT: Below is the CSS of the table and TD

   table.display {
margin: 10px;
padding: 5px;
clear: both;
width: 98%;
overflow: auto;
/*    text-align: center;*/
height: auto;

    }

    table.display td {
        padding: 5px 5px;
     }

    table.display td.center {
        text-align: center;
    }

EDIT: I have uploaded 2 images to show the differences between the tables.

http://imageshack.us/photo/my-images/840/correecttable.png/

That is the table when it is not hidden.

http://imageshack.us/photo/my-images/822/incorrecttable.png/

That is the table when it is hidden and then shown using jQuery.

  • 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-12T01:31:41+00:00Added an answer on June 12, 2026 at 1:31 am

    When the page originally loads the datatable is formed using the css files as laid out. However when it was calling the javscript it was rebuilding the datatable and ignoring any CSS files I had referenced. As such it was automatically shrinking the table to match the size of the text. This was avoided by setting bAutoWidth = false in the actual creation of the datatable.

    Thanks to everyone who helped!

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

Sidebar

Related Questions

EDIT: solved it, turns out I should use %c not %s because foodSelect and
edit This question is solved! Having something weird. I'm using html { font-size: 100%
EDIT: Solved. An attempt to bind a DataTable to the DDL accidentally happened twice
-- EDIT -- Solved by using JSON dataType. -- QUESTION -- Hello, I am
EDIT: solved, look below for my solution. first of all, this is my very
Edit: [Solved] : It seems that the getTableCellRendererComponent of the CustomTableCellRenderer is called every
Edit: Solved. Hi, I'm starting with Qt, I try to connect a slot to
edit: Solved - mod_rewrite was the problem I can't get CI to work as
EDIT: SOLVED Thanks Brooks. Your question led me to keep digging into if the
[EDIT: Problem solved. Please see my answer below.] In my app I call 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.