Here Mudassar Khan has explained with an example, how to export HTML string to Excel file in ASP.Net Core MVC.
First, the HTML Table will be populated from database using Entity Framework and then the HTML Table will be sent as HTML string to the Controller which will be exported to Excel file in ASP.Net Core MVC.