julious ceazer
julious ceazer

Reputation: 331

Hide a table using jQuery

I would like to keep a table hidden at the time of loading. Later I would like to slideDown that table to show when a link is clicked.I write this code to hide that table.

$('.table_div').hide();

I placed that table in a div. Then I hide that div.

My problem is at time of loading first the table display for a moment then the table hide. I would like to prevent this display. Thanks

Upvotes: 1

Views: 76

Answers (3)

user4988789
user4988789

Reputation:

Put all jquery statements in between these curly braces:

$(document).ready(function(){}

So that all scripts execute only after document is loaded. For the starting display, use

.table_div{display:none;} 

in the css page. Does it work now?

Upvotes: 0

Aabid
Aabid

Reputation: 941

You can add css to hide it

.table_div {
     display: none;
}

after load page just show it

$(document).ready(function(){
    $(".table_div").slideDown();
});

Upvotes: 1

Karthi Keyan
Karthi Keyan

Reputation: 804

To prevent that Add Css Property to .table_div

.table_div {
     display: none;
}

Upvotes: 5

Related Questions