Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2004
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    put into 2 columns

    I have a list of 26 NBA teams inserted from a DB. The problem is they list dynamically all the way down. I want the 1st 13 in 1 column and the the rest in the 2nd column.

    Code:
    <table width="50%" border="0" align="center" cellpadding="4" cellspacing="2">
      <tr bordercolor="333333" bgcolor="#333399"> 
        <th colspan="2"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">NBA 
          Teams </font></th>
      </tr>
      <%	Do Until getProducts.EOF %>
      <tr bordercolor="999999" bgcolor="EEEEEE"> 
        <td width="50%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="product01.asp?cat=<%=getProducts("pCategory")%>"><%=getProducts("pCategory")%></a></font></td>
        <td width="50%"></td>
      </tr>
      <%	getProducts.MoveNext
    	Loop %>
    </table>

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    probably the best way of doing this is to populate an array
    Code:
    Dim arrTeams(25)
    i = 0
    Set rsTeams = objConn.Execute("SELECT name FROM teams")
    Do While NOT rsTeams.EOF
    	arrTeams(i) = rsTeams("name")
    	i = i + 1
    Loop
    Set rsTeams = Nothing
    
    Response.Write "<table>"
    For i = 0 to 13
    	Response.Write "<tr><td>" & arrTeams(i) & "</td><td>" & arrTeams(i+13) & "</td></tr>"
    Next
    Response.Write "</table>"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •