I am using a webGrid and would like to be able to change the width of the columns. I am using the following code for the style but it seems to have no affect.
webGrid.Column(columnName: “TRP_Comments”, header: “Comments”,style: “width:500px;”),
Is this not what style is suppose to do?
Thanks
Bruce
I am using a webGrid and would like to be able to change the
Share
The
styleproperty doesn’t set thestyleattribute but theclassattribute. Yeah, I know, WTF. The designers of the WebGrid component must have been mentally disturbed at the moment they choose the name of this optional argument. The whole dynamic and optional arguments stuff they put into this component makes me hate it like hell and never use it in any application.Anyway, you could define a custom CSS class in your separate CSS file:
and then assign this class to the corresponding
<td>elements: