function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VVHVVH 

how to remove column from data table in lwc

I'm trying to remove a column in lwc when certain condition is met. Is there any attribute or something from which i can make the visiblity of column true/false. 
@track hideCoulmn;
    @track columns = [
        {
            label: "column1",
            hideDefaultActions: "true",
            editable: false,
            sortable: false },
        {
            label: "column2",
            fieldName: "culomn2___c",
            type: "text",
            hideDefaultActions: "true",
            editable: false,
            sortable: false,
           //needs to be hidden when hideColumn=true
        },
so can i have @track property called @track hideCoulmn and make it true/false whenever i need and by that hide the column? is it possible?
ravi soniravi soni
hy,
tableHeader = true;
use hide-table-header={tableHeader}  and hide/show your table header. this property is boolean
don't forget to mark it as best answer.
Thank you
VVHVVH
Hi,
Thanks for the reply, maybe i wasnt clear before
I want to hide only the second column. hide-table-header will hide all the colums but i want to hide only the column2. so is it possible to acieve it?
Soporte SistemasSoporte Sistemas
Hi, there are a solution