View Full Version : put into 2 columns

12-12-2004, 07:08 PM
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.

<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>
<% 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>
<% getProducts.MoveNext
Loop %>

12-13-2004, 04:29 PM
probably the best way of doing this is to populate an array

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
Set rsTeams = Nothing

Response.Write "<table>"
For i = 0 to 13
Response.Write "<tr><td>" & arrTeams(i) & "</td><td>" & arrTeams(i+13) & "</td></tr>"
Response.Write "</table>"