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

Limit to 6 columns across 1

Status
Not open for further replies.

DebbieDavis

Programmer
Jun 7, 2002
146
0
0
US
Hi there, didn't know quite how to search for this. I'm pulling in file names from fso and would like them to display 6 across, unlimited down. I know how to do that with a recordset but I'm not smart enough to how do I do it using objFile in a for next loop?
 

DesiredColumns = 6
ColCounter = 0

for each file in FSO.Files
colcounter = colcounter +1
If ColCounter = 1 then
Response.Write "<tr>"
End If
Response.Write "<td>" & File.Name & "</td>"
If ColCounter = DesiredColumns then
ColCounter = 0
Response.Write "</tr>"
End If
Next

'this next section is just to neatly wrap off the table if you dont happen to have the exact even number of files for the grid

If ColCounter <> 0 Then
For i=ColCounter to DesiredColumns-1
Response.Write "<td>&nbsp;</td>"
Next
Response.Write "</tr>"
End If


[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Outstanding Robert. You always come through. Thanks so much for your helped. It worked like a champ!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top