With pure CSS, you cannot do this. With jQuery (which your question is related to) you can:
$("table:not(:has(table))")...
will select tables without child tables.
The :has() selector finds elements that have a specific child. :not() inverts the selection to those who do not have this particular descendant.
source share