Show only rows with empty cell for specific column

Hi,
I’ve got a table where in a specific column some cells are empty, is there any way to reorganise/filter the table after a checkbox is ticked so I can only show the rows with empty cell? I’ve attached a picture, the column is “proprietario”

Too few Information. Variants…

  1. Completelly page reload with new filter params in _GET

  2. Table refresh with AJAX. Client sends filter params, server responses back with JSON, client builds table.

  3. Client side pure. Client ready has table data in JSON format and rebuilds filtered table.

and so on…

It is not clear, which variant you mean.

1 Like

Hi @vincekaribusana, since you tagged this topic with jQuery…

$('tr:has(td:nth-child(6):empty)').hide()

(There’s also a specification for using :has in vanilla JS queries, but it’s not yet implemented by any browser.)

Hi @m3g4p0p I believe this is what I was looking for, the only problem in that your code does hide all the empty cells but i need to do the opposite, hide the cell with text and show the empty one. Could you help me with this? many thanks

:not()

2 Likes

Perfect it works fine :wink: many thanks

Hi @m3g4p0p there a way to show only the cell that contains a dropdown without any options? Many thanks

Hi @vincekaribusana, the :empty pseudo class also works for select elements.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.