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 3 of 3

Thread: adding rows

  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post adding rows

    hi

    im using the following asp/html script:

    Code:
    <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

  • #2
    New Coder
    Join Date
    Nov 2005
    Location
    Central Indiana
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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):

    Code:
    <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 "<%")

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    k, thanx

    ill have a lk this weekend and see if it works

    thanks
    sandeep


  •  

    Posting Permissions

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