This article is a mirror article of machine translation, please click here to jump to the original article.

View: 16794|Reply: 0

[ASP.NET] asp.net a loop array of 5 rows to display as a table

[Copy link]
Posted on 12/11/2015 6:13:55 PM | | | |



Show an array of 5 rows!

Front Desk Code:

  1. <table>
  2.         <% for (int i = 0; i < str.Length/5+1; i++) {
  3.                Response.Write("<tr>");
  4.                for (int j = 0; j < 5; j++)
  5.                {
  6.                    if (5 * i + j < str.Length)
  7.                    {
  8.                         Response.Write("<td>" + str[5 * i + j] + "</td>");
  9.                    }
  10.                }
  11.                Response.Write("</tr>");
  12.            }%>
  13.     </table>
Copy code
Background:
  1. public static string[] str = new string[] { "lol","魔兽","飞车","欢乐豆","地主","麻将","赛车"};
  2.         protected void Page_Load(object sender, EventArgs e)
  3.         {

  4.         }
Copy code







Previous:The student information of a certain school was leaked by the telecommunications "campus network", handled a number of businesses and was blacklisted
Next:Oracle database download and installation procedures
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com