Plus ASP output n row N column table

Source: Internet
Author: User

In almost every site we have to use programs to output lists: News listings, product lists, and so on, the way the output is different from the content, for news listings, usually a row of the cycle output; For a product list, the output of one cell is usually one cell. Below we will use ASP to output a five-element four-column table.

1, one line of output

The following are the referenced contents:
<%
Response.Write ("<table border=" "1" "Width=" ">")
For I=1 to 5
Response.Write ("<tr><td> </td><td> </td><td> </td><td> </td>" </tr> ")
Next
Response.Write ("</table>")
%>


There's nothing to talk about, everyone can see it.

2, the output of a cell cell

The following are the referenced contents:
<%
Response.Write ("<table border=" "1" "Width=" ">")
For I=1 to 18
If I mod 4 = 1 Then Response.Write ("<tr>")
Response.Write ("<td> </td>")
If I mod 4 = 0 Then Response.Write ("</tr>")
Next
' Complement cell
i = I-1
If I mod 4<>0 Then
For J=1 to 4-i MoD 4
Response.Write ("<td> supplement </td>")
Next
Response.Write ("</tr>")
End If
Response.Write ("</table>")
%>

This side needs to explain: Many online output n row n column table ASP does not consider the last row of the number of columns is complete, that is, there is no upper part of the complement, the results of the output of a defective table. The details of the problem, although not small, but still want to pay attention to.



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.