0

I have problem with my table.I use jQuery function .hide().

 $("#table").hide();

And that works perfectly, but there is one problem.After reloading page, my table shows up for couple seconds and then hide. I have been trying many things, i put .hide() function first in list but still nothing.

I used $("#table").css("display", "none"), but still i have same problem.

What should i do?

3
  • Can you provide us with a quick jfiddle please? Will be easier to help :)
    – Ahs N
    Commented Jul 9, 2015 at 11:50
  • Better style <table>'s display on markup, as if you put the code before table render, js can't get table, but if you put it after table markup, table should show before it's hide. Commented Jul 9, 2015 at 11:50
  • Sounds like it should be easily fixable. But can you provide a minimal, complete code sample in your question where we can look at? Something which can be run in, for example, jsfiddle?
    – Juliën
    Commented Jul 9, 2015 at 11:53

2 Answers 2

1

You could do something like,

Add style to table For Example,

<table id="table" style="display: none">
  <thead>
    <tr>
      <td>Name</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Thiru</td>
    </tr>
  </tbody>
<table>
1
  • Thanks mate. I am new here so i cant give you a positive feedback.Anyway thanks.
    – NSKBpro
    Commented Jul 9, 2015 at 13:08
1

You do not need to use jQuery to hide content on load, just use display: none.

#table {
  display: none;
}

To answer to your question, I you are using hide() into a $(document).ready(function() {}). So it is executed after your page is fully loaded.

Not the answer you're looking for? Browse other questions tagged or ask your own question.