How to hide table data upon load and only show table headers?

How to hide table data upon load and only show table headers?

Noodles12Noodles12 Posts: 107Questions: 38Answers: 2

This is continuation of my previous question. https://datatables.net/forums/discussion/73443/how-to-load-a-table-blank-when-no-filter-is-selected#latest

Here is the updated table. Although the filter portion works here, I am unable to figure out how to display only headers/ upon page load or when Select Location is selected from the dropdown.

Please see sample code here:

http://live.datatables.net/milazige/3/edit

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,275Questions: 26Answers: 4,765
    edited July 2022 Answer ✓

    In the example I provided in the other thread i used style="display: none;" to hide the tbody. Another option is to use jQuery to hide the tbody with jQuery hide(). Just toggle the tbody with show() and hide() as desired.

    Kevin

Sign In or Register to comment.