tags:

views:

34

answers:

1

Hi,

In an Html.Grid, how can we ensure that data in the column (e.g. currency amounts) gets right aligned?

Thanks.

+1  A: 

You mean in the MvcContrib Grid?

You could use something like:

column.For(x => x.Amount).Attributes(style => "text-align:right");

or more tidily you could set a class:

column.For(x => x.Amount).Attributes(@class => "right-align");

and set an appropriate style rule on that class.

David
+1 Works like a charm! Thanks David :)
Rashmi Pandit