|
|
Hi i am using the filesystem object to retrieve a list of files - well graphics actually which I want to display in a table with 3 columns & then however many rows
I can display the list no problem
Its getting the table to break after 3 cells and create a new row
I am trying this code
Can anyone help please ?
<%
Dim iCurrentCell
iCurrentCell = 1 ( i though i could use this to count number of cells & then get a new row !)
Dim myFSO, myFolder, myFile, strPath
strPath=Server.MapPath ("/graphics/baby")
Set myFSO = Server.CreateObject("Scripting.FileSystemObject")
Set myFolder = myFSO.GetFolder(strPath)
Response.Write "The files in <b>" & myFolder.Name & "</b> Folder are: <br> <br>"%>
<table border='1'>
<tr>
<%
For Each myFile in myFolder.Files
Response.Write "<td>" & myFile.Name & "<td>"
iCurrentCell = iCurrentCell + 1
If iCurrentCell > 3 then
Response.Write(" </tr> ")
iCurrentCell=1
End if
Next
%>
</table>
Yours hopefully
|
|
|
|
serafina - looks about right, except shouldn't it be:
If iCurrentCell > 3 then
Response.Write(" </tr><tr> ")
iCurrentCell=1
End if
|
|
|
|
|
|
|
|