Hide Columns in a DataTable

Hello Again

I have a quick question on how to hide columns in a DataTable.

i need to hide the checkbox and the Edit button within a row.

I managed to do so already this much:

  • Removed the first and second header


  • removed the edit and checkbox but somehow the column where the checkbox is in is still there:


image image

i think i may be using the wrong class but within a row there is no class to adress, with exception of the command-cell class, which shows the pencil. all the other columns are just "roles" which probably explains why only the checkbox is gone and not the field itself. is there another approach to adress roles instead of classes?


I found the Solution.
Instead of adressing the single cells in the table i'm hiding just the whole columns with this code:

Like this, one can target whichever column you want.
with td for the cell itself and th for the header

1 Like