MVC3 WebGrid header alignment

2019-08-04 06:49发布

WebGrid (Razor)

How can the headers alignment be set?

I need to be able to change the alignment for each column (could be different)

It seems to be a all or nothing deal nor does it seem to take the alignment of the child TD.

1条回答
放我归山
2楼-- · 2019-08-04 07:09

There currently is not a way to set a different style for each column header using the WebGrid in MVC 3. You can however use the tableStyle property to set the style for all column headers.

.header { text-align: left; }

@var grid = new WebGrid(Model);

@grid.GetHtml(headerStyle: "header")

查看更多
登录 后发表回答