日期:2014-05-17  浏览次数:20429 次

Padright 补空格补不上
我想通过补空格的方式,进行对齐,但是补不上,只有一个空格,其它的被截断了,请问该怎么办?

谢谢


            foreach (var cat in cateTeam.SubCategories)
            {
                if (cat.IsMagazine.HasValue && cat.IsMagazine.Value)
                {
            @Html.ActionLink(cat.Name, "Magazine", "Lib", new RouteValueDictionary { { "id", cat.ID } }, null);       //杂志类型
                }
                else
                {
            @Html.ActionLink(cat.Name, "Category", "Lib", new { id = cat.ID }, new { target = "_blank", title = cat.Name })  //一般分类
                }

                counter6 = counter6 + 1;
                if (counter6 % 6 == 0)
                {
            <br />
                    counter6 = 0;
                }
                else
                {
                    string strTemp = string.Empty;
                    int length = cat.Name.Length;
                    @strTemp.PadRight(15 - length, ' ');
            
                }
            }

------解决方案--------------------
该回复于2013-04-09 11:50:07被管理员删除