Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page layout is off

Status
Not open for further replies.

loveday

Programmer
Sep 19, 2004
106
US
I am using this page as a "specials" page.

A page where products that are on specially discounted prices are stored.

So far, all my products are lining up like this:

image1 image2 image3 image4 .....

THe more images you put on this page, the more they line up on one row.

I would like something like:

image1 image2

image3 image4 etc.

My mod conditional is not working.

Please assist.

Thank you:

Here is the dreaded code:
Code:
<table width="100%" cellspacing="0" cellpadding="0" align="center" class="bodytextcolor">

<tr>
 <td valign="top" class="body1">
 	<img src="images/MHP_ProductSpecials.gif" width="325" height="50" alt="" border="0">
 	<br><hr color=steelBLUE width=90%><br>
 	Listed below are the products we currently offer at a discount off of the already low Millennium Health Products price. Check back often, as we are constantly adding new specials to our list.
 	<br>
</td>
</tr>
<%
'Set DataConnection = Server.CreateObject("ADODB.Connection")
'DataConnection.Open "ship"
set rs = Server.CreateObject("ADODB.RECORDSET")
 Set DataConnection=Server.CreateObject("ADODB.Connection")
 DataConnection.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
 "DATA SOURCE=" & server.mappath("admin\scart.mdb")

sqlstmt = "SELECT * FROM products INNER JOIN specials " _
         & " ON products.ccode = specials.code " _
         & " WHERE DATE() BETWEEN specials.startdate AND specials.enddate"
'Response.Write "DEBUG: " & sqlstme & "<HR>"
set rs = DataConnection.Execute(sqlstmt)
%>
<br><br><br><br>
<%
Response.Write "<table width='100%' border=0 cellspacing=0 cellpadding=0>"
Response.Write "<tr>"

If rs.eof then
response.write "<marquee bgcolor='#ffffff' scrolldelay='1' border='1' align='left' width='100%' scrollamount='2' height='21'><b>We're sorry. We are not offering any Product Specials at this time. Please check back soon.</b></marquee>"

else

While not rs.eof
cimage=rs("cimageurl")
i=1
			Response.Write "<td class=bodytextcolor width='33%' align=center nowrap>" & vbcrlf
			Response.Write "<br><img src=" & q& "img/small/" & rs("cimageurl") &q& " align=" & q& "center"& q & " WIDTH='97' HEIGHT='125'>" & vbcrlf
			Response.Write "<br>" & rs("cname") & " " & vbcrlf
			Response.Write "<br>Regular Price: <font color=red>" & FormatCurrency(rs("cprice"),2) & "</font>" & vbcrlf
			Response.Write "<br><font color=green>10 or more:</font><font color=red> " & FormatCurrency(rs("cover10price"),2) & "</font>" & vbcrlf
			Response.Write "<br><font size=-1><a href=""product.asp?id=" & rs("catalogID") &q&">View Details</a></font>" & vbcrlf & vbcrlf
			Response.Write "<form action=""addprod.asp"" method="&q&"POST"" name=form"&i&" onSubmit="&q& "return checkItems(form"&i&")" & q&">" & vbcrlf
			Response.Write "<input type=""hidden"" name=""fproductid"" value="&q & rs("catalogID")& q&">" & vbcrlf
			Response.Write "Quantity: <input maxLength=""6"" name=""fquantity"" size=2 value=""1"">" & vbcrlf
			Response.Write "<input type=""submit"" value=""ORDER"" name=""order"" style=""font-family: Arial; color: #800000; font-weight: bold"">"
			Response.Write "</form>" & vbcrlf
if (i mod 2) = 0 then
 Response.Write "</td></tr>"
end if
i = i + 1
rs.MoveNext
Wend
%>
</table>
<%
end if
%>
 
Code:
While not rs.eof
cimage=rs("cimageurl")
[highlight]i=1[/highlight]
            Response.Write "<td class=bodytextcolor width='33%' align=center nowrap>" & vbcrlf
            Response.Write "<br><img src=" & q& "img/small/" & rs("cimageurl") &q& " align=" & q& "center"& q & " WIDTH='97' HEIGHT='125'>" & vbcrlf
...

barcode_1.gif
 
This is thread I wanted to respond to.

Tarwn,
what is the difference between that syntax you highlighted and the one I posted?
 
I believe he's indicating that you should move that line (i=1) to outside the loop (before the While). The way it is now I can't change each time through the loop.
 
I am so dumb!
That is so freaking obvious.

Thanks to you and to Tarwn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top