How to hide/suppress a html table is no data is presented?

How to hide/suppress a html table is no data is presented?
kgittingerAsked:
Who is Participating?
 
Brian PringleConnect With a Mentor Systems Analyst II, SCM, ERPCommented:
You can have the table itself created by ASP, PHP, whatever language you are using on the server.  Then, the creation of the table would be dependent on your IF statement.  

Something like this... (not exact)

IF there is data to put in the table
   document.writeline("<table>")
   document.writeline("<tr>")
   document.writeline("<td>" + %firstitem% + "</td>")
.
And so on...
.
.
ENDIF
0
 
Brian PringleSystems Analyst II, SCM, ERPCommented:
Is this data dynamically generated or is it manually entered?  If it is dynamic, then you could include an IF statement to comment out the table so that it does not appear.
0
 
Om PrakashCommented:
The best method is to use a server side language to generate the required table based on the data from database

To hide/show a table you can use the following:
document.getElementById("table_id").display = "";  //Show the table   
document.getElementById("table_id").display = "none";  //Hide the table 

Open in new window

0
 
kgittingerAuthor Commented:
The data is dynamically generated.  My if statement returns no data when appropriate, but I cannot seem to hide/suppress the table header/boarders...

I am new to this.  Thank you very much.
0
 
kgittingerAuthor Commented:
One more thing.  Each table is formed via a dynamic query.  The tables are not named.   Do the tables need to be named for the above to work?
0
All Courses

From novice to tech pro — start learning today.