Hi,
I'm having problems positioning results tables in ASP.
Basically it's a catalogue site and I want to display 2 products side by side in rows of however many products there are in the category.

At the moment all items in the catagory are appearing side by side in one long row.....Can any one advise me what I'm doing wrong?

Here is my code:

<style>
.bodyText{ font-family:Arial, Helvetica, sans-serif; font-size:11px
}
.whiteText{ font-family:Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; color:#FFFFFF
}
.dottedtd{ border-bottom:dotted thin #999999; font-family:Arial, Helvetica, sans-serif; font-size:11px 
}
</style>
<%
Randomize
CONST numFeatured = 9
' Retrieve Featured Products
IF NOT isArray (Application( "Featured" ) ) THEN
sqlString = "SELECT product_id, large_media_file_name, product_name, colours, sizes, qty5, qty25, qty50, qty100 " &_
"FROM Products WHERE best_seller = 1 " &_
"ORDER BY product_name"
SET Featured = Con.Execute( sqlString )
IF NOT Featured.EOF THEN
 featuredArray = Featured.GetRows()
 Featured.Close
 END IF
 
' Add the Array To Application Document
Application.Lock()
Application ( "Featured" ) = featuredArray
Application.UnLock
ELSE
 featuredArray = Application( "Featured" )
END IF
' Display Featured Products
topFeatured = UBOUND ( featuredArray, 2 ) + 1
skip = topFeatured / numFeatured
IF topFeatured <=numFeatured THEN skip = 1
%>
<table cellpadding="0" cellspacing="0" width="529">
<tr>
  <td height="20"></td>
</tr>
<tr>
  <td width="529"><img src="img/home/best_sellers_heading.jpg" alt="Our Best Sellers" width="529" height="65" /></td>
</tr>
<tr>
  <td>
    <table cellpadding="0" cellspacing="0" width="529">
      <tr>
        <% 
FOR i = 1 TO topFeatured - 1 STEP skip
offset = RND * (skip - 1)
product_id = featuredArray (0, i + offset)
large_media_file_name = featuredArray (1, i + offset )
product_name = featuredArray ( 2, i + offset )
qty5 = featuredArray ( 5, i + offset )
qty25 = featuredArray ( 6, i + offset )
qty50 = featuredArray ( 7, i + offset )
qty100 = featuredArray ( 8, i + offset )
colours = featuredArray ( 4, i + offset )
sizes = featuredArray ( 3, i + offset )
%><td width="225"><table width="220" border="0" cellpadding="2" cellspacing="5" >
            <tr>
              <td  class="dottedtd" align="center"><% IF productPicture <>"?????" THEN %>
                <img src="<%=large_media_file_name %>" hspace="4" vspace="4" border="0" align="middle" />
                <% END IF %>
              </td>
            </tr>
            <tr>
              <td  class="dottedtd" height="30"><b>Product Name  :&nbsp;</b> <a href="default_product.asp?pid=<%=product_id%>"><b><%=product_name%></b></a></td>
            </tr>
            <tr>
              <td  class="dottedtd" height="30"><b>Sizes  :&nbsp;</b> <%=sizes%> </td>
            </tr>
            <tr>
              <td  class="dottedtd" height="30"><b>Colours  :&nbsp;</b> <%=colours%> </td>
            </tr>
            <tr>
              <td  height="30" class="dottedtd"><b>PRICING</b></td>
            </tr>
            <tr>
              <td><table cellpadding="2" cellspacing="0" border="1" bordercolor="#999999">
                  <tr>
                    <td class="whiteText" height="20" bgcolor="#999999">Qty 100+ : </td>
                    <td class="whiteText" height="20" bgcolor="#999999">Qty 50+ : </td>
                    <td class="whiteText" height="20" bgcolor="#999999">Qty 25+ : </td>
                    <td class="whiteText" height="20" bgcolor="#999999">Qty 5+ : </td>
                  </tr>
                  <tr>
                    <td class="bodyText"><b><%=(qty100)%></b></td>
                    <td class="bodyText"><b><%=(qty50)%></b></td>
                    <td class="bodyText"><b><%=(qty25)%></b></td>
                    <td class="bodyText"><b><%=(qty5)%></b></td>
                  </tr>
                  <tr>
                    <td class="bodyText" colspan="4"> All Prices Exclude VAT</td>
                  </tr>
                  <tr>
                    <td  height="20" class="dottedtd" colspan="4"><a href="default_product.asp?pid=<%=product_id%>">GET MORE INFORMATION</a> </td>
                  </tr>
                </table></td>
 
 
            </tr>
          </table>
     </td>
    <td width="39" bgcolor="#FFFFFF">
    <td width="38">
     <td width="225"><% 
    NEXT 
    %></td>
      </tr>
    </table>
Member Avatar for GreenDay2001

it's happening 'cause you are using only one tr tag for displaying information. try to correct that

Not quite sure where you mean? Can you show me where?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.