TEL:150-0382-3679
新闻资讯 News Center
建站知识 / 公司动态
自动分配成样式不同的三列

   <%
            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                int counts = 6;
                if (counts % 3 == 0)
                {

                    int count = counts / 3;
                    for (int i = 0; i < count; i++)
                    {
                        for (int m = 1; m < 4; m++)
                        {
                            int index = 3 * i + m;
                            switch (m)
                            {
                                case 1:
                                %>
                                <%=index %>
                                -01
                                <%
                                    break;
                                case 2:
                                %>
                                <%=index %>
                                -02
                                <%
                                    break;
                                case 3:
                                %>
                                <%=index %>
                                -03
                                <%
                                    break;
                                default:
                                    break;
                            }
                        }


                        }
                        }
                        else
                        {
                            int count = counts / 3;
                            for (int i = 0; i < count; i++)
                            {
                                for (int m = 1; m < 4; m++)
                                {
                                    int index = 3 * i + m;
                                    switch (m)
                                    {
                                        case 1:
                                %>
                                <%=index %>
                                -01
                                <%
                                    break;
                                case 2:
                                %>
                                <%=index %>
                                -02
                                <%
                                    break;
                                case 3:
                                %>
                                <%=index %>
                                -03
                                <%
                                    break;
                                default:
                                    break;
                            }
                        }
                        }

                        int elsecount = counts % 3;
                        for (int m = 1; m <= elsecount; m++)
                        {
                            int index = 3 * count + m;
                            if (m == 1)
                            {
                                %>
                                <%=index %>
                                开始
                                <%
                                    }
                                    else
                                    {
                                %>
                                <%=index %>
                                <%
                                    }
                                    if (m == elsecount)
                                    {
                                %>
                                <%=index %>
                                结束
                                <%
                                    }


                                }
                            }
                        }
      
        %>

一站式全网营销,您身边的网络营销顾问,为您一对一私人定制符合您实际需求的网络营销实施方案!
24小时咨询热线:
150-0382-3679