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
Aditya RautAditya Raut 

How to add or remove the columns dynamically in LWC datatable? How to make Columns of datatable dynamic instead of hardcode?

SubratSubrat (Salesforce Developers) 
Hello Aditya ,

Requesting you to go through this article which would help you with your requirement -> https://www.linkedin.com/pulse/lightning-web-component-dynamic-datatable-fields-columns-charles/

This article througly explains that with the help of Custom Settings or Metadata Types you can easily achieve the Addtion and deletion of columns.

If it helps please mark this as Best Answer.
Thank you.