...

View Full Version : adding rows



sandeep89
11-26-2005, 03:19 PM
hi

im using the following asp/html script:




<table border="0" width="550" cellspacing="0" cellpadding="0" id="table1" height="38">
<tr>
<td width="75" class="head" background="images/mid01.gif" height="20">&nbsp;PICTURE</td>
<td width="33" class="head" background="images/mid01.gif" height="20">&nbsp;SKU</td>
<td class="head" background="images/mid01.gif" height="20" style="margin-left:10; margin-right:0;" width="333">&nbsp;ITEM</td>
<td class="head" background="images/mid01.gif" height="20" width="44">&nbsp;VISITS</td>
<td class="head" background="images/mid01.gif" height="20" width="65">&nbsp;PRICE</td>
</tr>




<tr>
<td width="72">
<div align=center>
<%if pSmallImageUrl<>"" then%>
<a href='comersus_viewItem.asp?idProduct=<%=pIdProduct%>'><img src="catalog/<%=pSmallImageUrl%>" border="0"></a>
<%else%>
<img src="catalog/imageNa_sm.gif" >
<%end if%>
</div>
</td>
<td width="33"><%=pSku%></td>
<td width="333"><a href='comersus_viewItem.asp?idProduct=<%=pIdProduct%>'><%=pDescription%></a></td>
<td width="44"><%=pVisits%></td>
<td width="65"><%=pCurrencySign & money(pPrice)%></td>
</tr>
</table>



the problem is that this script repeats for each product that fits in the terms that have been searched for.
The asp code is not really that important here, but if you look at the first row (i left some space between the rows, just for show), this row is a sort-of header row, with the titles in it, and then the second row has the information that is called from the databse.

I only want the second row to repeat, not the whole 2 rows.

I was thinking that i could get rid of the first row, and then i could add a script of some sort, which could add the first row on top of the others, so that the asp script finishes running, and the rows of items are added to the page, and then the script can add the row right at the top.

Can anyone here help me with this please, i've tried using some DOM, but i cant get anyting to do this...

ill giv more info if needed
thanx
sandeep

artman 186
12-02-2005, 10:02 PM
You don't need to do this with the DOM at all....just use your ASP.

I'm sure that you're following some pattern like this (pseudocode):



<table>
<%
for each object in the collection

%>

<tr>
<td><%= object.data1 %></td>
<td><%= object.data2 %></td>
<td><%= object.data3 %></td>
<td><%= object.data4 %></td>
<td><%= object.data5 %></td>
</tr>

<%

next object
%>
</table>


The solution is a piece of cake, just write out the header row before the code that does the looping (right under the <table> tag, before the first "<%")

sandeep89
12-03-2005, 11:23 AM
k, thanx

ill have a lk this weekend and see if it works

thanks
sandeep



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum