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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a table 1

Status
Not open for further replies.

malaygal

IS-IT--Management
Feb 22, 2006
192
US
I have a recordest that returned 12 records.
I need to populate a table with three columns with these records, making it a 4-row 3-column table
_________________________________________
| Area1 |Area2 |Area3 |
| ______________ |_____________|___________|
|Area4 |Area5 |Area6 |
| ______________ |_____________|___________|
|Area7 |Area8 |Area9 |
| ______________ |_____________|___________|
|Area10 |Area11 |Area12 |
|______________ |_____________|___________ |

I have this code that populates a 12-row 1-column table

if areaset.eof then
response.write "<b>No Listing available at this time.</b>"
else
areaset.movefirst
areacount = 1
%>
<table>
<tr><td colspan="2"><font face="Verdana, sans-serif" style="font-size: 8pt"><b>AREAS:</b>
<%
while not areaset.eof
%>
<td><input type=checkbox value = "<%=areaset("mem_name")%>"><font face="Verdana, sans-serif" style="font-size: 8pt"><%=areaset("mem_desc")%></td>
<tr>
<%
areaset.movenext
areacount = areacount + 1
wend
end if
%>
</table>

Any help will be greatly appreciated.


 
Just stick in a </tr><tr> after every 3 items.
Code:
....
areaset.movenext    
areacount = areacount + 1
[COLOR=red]if areacount mod 3 = 1 then
response.write("</tr><tr>")
end if[/color]
 wend
....

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Thank you very much. It worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top