Before you begin going through this post kindly make sure that you have understanding of lightning components and how they work. Lightning Web Component lightning-datatable. Pass in the fields to lightning:inputField, which displays an input control based on the record field type. See the modules Aura Components Basics and Lightning Web Components Basics. This post explains how to sort the lightning data table data in lightning web components(lwc) Example: HTML Code