手动实现一行多列

        string str = "<li>";
        int rows = 9;
        for (int i = 0; i < rows; i++)
        {

            str += "   <span> " + i.ToString() + "</span>";
            if (  i>0   && (i+1) % 2 == 0 && (i+1)<rows)
            {
                str += ("</li><li>");
            }

            if ((i + 1) == rows)
            {
                str += ("</li>");
            }
        }

        Response.Write(str);
        Response.End();

posted on 2010-01-20 23:39  alon  阅读(159)  评论(0编辑  收藏  举报

导航