---
title: "FSO"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/49575-fso"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Asa"
published: "2002-08-05T16:11:22.000Z"
updated: "2002-08-05T17:11:23.000Z"
replies: 7
views: 231
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/49575-fso"
---

# FSO

## #1 — Asa, 2002-08-05T16:11Z

Hur gör jag för att baka ihop detta! Jag listar filer i en mapp som ska hamna 3 per rad!

```
<%Antal = 3

For Each File In Mapp.Files
    Response.Write "<tr>"
For i=1 to Antal
    Response.Write "<td align=center>"
If Mapp.Files.Count = 0 then
    Response.Write "&nbsp;"
Else%>
    <img src="<%=MappNamn%>/<%=File.Name%>" width="150" border="1"><%End If
Response.Write "</td>"
Next
     Response.Write "</tr>"
Next
End If%>
```

Permalänk: https://www.webforum.nu/p/49575

## #2 — trexter.com, 2002-08-05T16:17Z

Baka ihop?

Permalänk: https://www.webforum.nu/p/744125

## #3 — LarsG, 2002-08-05T16:21Z

```
<%
cnt = 0
For Each File In Mapp.Files    
      if cnt mod 3 = 0 then 
         if  cnt > 0 then response.write "</tr>"
         Response.Write "<tr>"
      end if
%>
    <td align=center><img src="<%=MappNamn%>/<%=File.Name%>" width="150" border="1"></td> <%
cnt = cnt + 1
next
response.write "</tr>"
```

Permalänk: https://www.webforum.nu/p/744129

## #4 — Asa, 2002-08-05T16:22Z

Ja - just så! Går ju ej å ha två For vettu! När man raddar upp från databas är det enkelt! Då har man ju Do Until RS.EOF istället för  For Each File In Mapp.Files! Första Next är ju RecSet.MoveNext typ!

Permalänk: https://www.webforum.nu/p/744130

## #5 — Asa, 2002-08-05T16:24Z

Supertack LarsG - funkar fint! :)

Permalänk: https://www.webforum.nu/p/744132

## #6 — Asa, 2002-08-05T16:50Z

Men hur får man så att om man vill ha 3 på rad och man bara har en bild och så blir det tomt i de andra två kolumnerna! Alltså! Jag vill ha 3 kolumner jämt!

Permalänk: https://www.webforum.nu/p/744146

## #7 — LarsG, 2002-08-05T17:07Z

Du får kontrollera efter loopen om det gick jämnt ut 

```
<%
cnt = 0
For Each File In Mapp.Files
      if cnt mod 3 = 0 then 
         if  cnt > 0 then response.write "</tr>"
         Response.Write "<tr>"
      end if%>
    <td align=center><img src="<%=MappNamn%>/<%=File.Name%>" width="150" border="1"></td> <%
cnt = cnt + 1
next
if cnt mod 3 <> 0 then
   for i = 1 to 3 - cnt mod 3 %>
        <td vad du nu vill ha i de tomma kolumnerna> </td> <%
   next
end if
response.write "</tr>"
```

Permalänk: https://www.webforum.nu/p/744152

## #8 — Asa, 2002-08-05T17:11Z

Tackar igen för ett bra svar! :)

Permalänk: https://www.webforum.nu/p/744153

---

Tråden på webben: https://www.webforum.nu/amne/asp/49575-fso
