Here is what worked for me. In grids, htmlAttributes assigns an identifier to the resulting table. In this example, "gridT". In CSS, create a style for "#gridT", for the second column, align the text on the left.
@grid.GetHtml( . . htmlAttributes: new { id = "gridT" }, columns: grid.Columns( grid.Column(columnName: "ID", header: "ID"), grid.Column(columnName: "Name", header: "Name") <style> #gridT th:nth-child(2) { text-align: left; } </style>
The second column "Name" will be left aligned.
source share