PDA

View Full Version : Repeat Region Question


Thatguy2001au
10-15-2002, 09:29 AM
Hi

I have a page on my website where i collect data from a database and these are placed into a table which is centered on the screen.

I am using Dreamweaver MX and can easily make this table repeat as much times as i want to. The problem is, that when it repeats the table, it puts each table underneath the other.

What i want to be able to do is have like 2 columns instead of the one. So, i would like them to repeat how they are except i want to have 2 next to each other and 2 below that and so forth. that is where i get stuck. How would i get it to show 2 tables on the one row instead of the default of just the one?

I know it has something to do with setting the number of columns to 2 but i am not sure how this is done.

Can anyone help???

raf
10-15-2002, 10:14 AM
I don't use dreamweaver and i can't see the point in repeating tables.

You problem comes down to : how can i create a table with two cells on every row ? (table with 2 colums)

My examplecode (VB-script in ASP page):




dim row
row= "0"
response.write("<table border='0' cellpadding='5' cellspacing='0' width='95%'>")
response.write("<tr bgcolor='#c6d8df'>")
response.write("<td><b>Name Collumn1</b></td><td><b>Name column2</b></td>")
response.write("</tr>")

do while rsKlanten.EOF= false
if row MOD 2 = 0 then
response.write("<tr bgcolor='#ddf1f9'>")
else
response.write("<tr bgcolor='#e0ebeb'>")
end if
response.write("<td>" &server.HTMLEncode (rsKlanten.Fields("variablename")) &" </td>")
response.write("<td>" &server.HTMLEncode (rsKlanten.Fields("variablename2")) &" </td>")
response.write("</tr>")
row = row+1
rsKlanten.MoveNext
loop
response.write("</table>")




Creates a table with tha columns to store in two variables. If you want to store the same variables in each of the columns (can immagen why, though) you just entre the same variablename twice.
(This code has a little extra : alternating backgroundcolor for each row)

If this was not what you were looking for, please clarify your question and maybe post some code or an exaplepage.

Thatguy2001au
10-15-2002, 11:32 AM
Thanks Raf

I ended up working it out. I just modified some other code.

Thanks again.

whammy
10-16-2002, 01:26 AM
P.S. This question should have been posted in the General Web Design forum, since it didn't have to do with ASP, specifically. ;)

Since the question was answered to your satisfaction, I'll close this. :D