views:

220

answers:

1

I have a table on my page and I want to display a message telling the user that they need to create content before the table is visible.

Currently when the table is empty the user can still see the table headings( article, date added etc)

Using Jquery how would I hide the table and the div containing the table?

Do you know what I mean?

A: 

Like this:

$('table:not(:has(ContentSelector))').each(function() { 
    //This code will run for each empty table.
    //`this` will be the <table> element
});

Where ContentSelector is a selector that matches the content in the table.

SLaks
That works great and will really help me out on my project. How would make it perfom a function?
What do you mean?
SLaks
$('table:not(:has(ContentSelector))').(function(){ $('div').hide(),$('table').hide });something like this??