Last post Mar 24, 2016 04:32 AM by Yohann Lu
Mar 23, 2016 10:57 AM|NatarajYashash|LINK
I had created 7 tables like table1,table2...and tables contains lables and textboxes.now i am going to bind data from database values to table using some query.some times only table1 and table2 having values remaining are does not have the value.in this
case i want to hide the remaining tables.only showing value contained tables.
Mar 23, 2016 02:32 PM|Nataraj Gandhi Arunachalam|LINK
You can use jquery to set a display:none class to the tables that do not have any value to be bound. Since anyway you are using jquery to bind data from client end, why not dynamically just create tables that you need to display data based on your results
$("#[table that does not have any data to be bound").css("display", "none");
Mar 24, 2016 04:32 AM|Yohann Lu|LINK
As Gandhi Arunachalam said, you can use jQuery to implement it. Basically, you can find all tbody elements that are empty using the :empty filter and hiding the parent table element.
The following tutorial for your reference.
Hiding Tables with Empty Body Elements With jQuery:
Hide html table on page load using Jquery: