MVC3 WebGrid header alignment

孤街浪徒 提交于 2019-12-11 08:53:06

问题


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:


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")



来源:https://stackoverflow.com/questions/9198125/mvc3-webgrid-header-alignment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!