HTML.Grid右对齐列中的数据 [英] Html.Grid right align data in column

查看:330
本文介绍了HTML.Grid右对齐列中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Html.Grid中,如何确保列中的数据(例如货币金额)正确对齐?

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

谢谢.

推荐答案

您的意思是在MvcContrib网格中吗?

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.

这篇关于HTML.Grid右对齐列中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆