On dynamic multiple rows and columns, cyclic rows and columns, output m rows n columns of ASP code _ Application Tips

Source: Internet
Author: User
It's a real hassle now, is it easy enough to be clear?
Copy Code code as follows:

<%
Dim I, J, Icols
i = 0 '//definition I for loop
Icols = 3 '//row with several columns (positive integer)
Response.Write ("<table width=" "100%" "border=" "1" "Cellspacing=" "2" "cellpadding=" "0" "><tr>" & vbNewLine) '//Output table header and first TR
Do as not ors.eof '//Start output Recordset with for ORs. RecordCount Next, too.
If i>0 and i Mod icols = 0 Then Response.Write ("</tr><tr>" &vbnewline) '//If the number of columns equals icols line-wrapping
i = i + 1
Response.Write ("<td width=" "" &formatpercent (1/icols, 0) & "" "> Output page" &i& "Record </td>" & vbNewLine)
Ors.movenext
Loop '//End output recordset
Ors.close
For j = 1 to iCols-1 '//start to complement empty records, up to ICols-1
If I Mod icols = 0 Then Exit for '////Column count is enough icols no longer output
i = i + 1
Response.Write ("<td width=" "" &formatpercent (1/icols, 0) & "" "> Complement the first" &j& "Record </td>" & vbNewLine)
Next
Response.Write ("</tr></table>" &vbnewline) '/output table end
%>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.