trippleS: doUntil-Schleife der Datenbankabfrage tötet meine Tabellebreite

Beitrag lesen

..klingt drastisch, aber das ist es auch!

Hallo,

ich gebe meine News-Artikel aus, indem ich die innerhalb einer do-Until-Schleife eine case-Select-Abfrage habe, bei der ich den Komponententyp abfrage und je nachdem - ob es ein Bild, eine URL, Fliesstext oder sonstwas ist.. - den Datenbankstring formatiere..

*code*

do until objRS.EOF
  tmpIntComponentTypeID = objRS("intComponentTypeID")

select case tmpIntComponentTypeID
   case 1
    tmpComponentCode = "<span class=""head1"">"&objRS("strString")&optionOneCode&optionTwoCode&"</span>"
   case 2
    tmpComponentCode = "<span class=""head2"">"&objRS("strString")&optionOneCode&optionTwoCode&"</span>"
   case 4
    dbString = objRS("strString")

tblWidth = Mid(dbString, InstrRev(dbString,"/"))
    tblWidthLength = Len(tblWidth)
    tblWidth = CInt(Right(tblWidth, tblWidthLength-1))

imgName = Left(dbString, InstrRev(dbString,"/"))
    imgNameLength = Len(imgName)
    imgName = Left(imgName, imgNameLength-1)

if blnOptionOne = true AND blnOptionTwo = true then
     tmpComponentCode = "<table width="""&tblWidth&""" border=""0"" cellpadding=""0"" cellspacing=""0"" style=""float:right; margin-right:3px; margin-bottom:3px;""><tr width="""&tblWidth&"""><td><img src=""../../upload/"&imgName&""" border=""0""></td></tr>"
    end if

if blnOptionOne = true AND blnOptionTwo = false then
     tmpComponentCode = "<table width="""&tblWidth&""" border=""0"" cellpadding=""0"" cellspacing=""0"" style=""float:left; margin-right:3px; margin-bottom:3px;""><tr width="""&tblWidth&"""><td><img src=""../../upload/"&imgName&""" border=""0""></td></tr>"
    end if

if blnOptionOne = false AND blnOptionTwo = true then
     tmpComponentCode = "<table width="""&tblWidth&""" border=""0"" cellpadding=""0"" cellspacing=""0"" align=""right""><tr width="""&tblWidth&"""><td><img src=""../../upload/"&imgName&""" border=""0""></td></tr>"
    end if

if blnOptionOne = false AND blnOptionTwo = false then
     tmpComponentCode = "<table width="""&tblWidth&""" border=""0"" cellpadding=""0"" cellspacing=""0""><tr width="""&tblWidth&"""><td><img src=""../../upload/"&imgName&""" border=""0""></td></tr>"
    end if
   case 5
    if blnOptionOne then
     endFloat2 = "<br style=""clear:left;"">"
    else
     endFloat2 = ""
    end if

if blnOptionTwo then
     endFloat1 = "<br style=""clear:right;"">"
    else
     endFloat1 = ""
    end if

if objRS("strString")<> "" then
     tmpComponentCode = "<tr bgcolor=""#ECECFF""><td class=""tdBildunterschrift"">"&objRS("strString")&"</td></tr></table>"&endFloat1&endFloat2
    else
     tmpComponentCode = "</table>"&endFloat1&endFloat2
    end if
   case ....

case else
    tmpComponentCode = ""
  end select

Response.Write tmpComponentCode

objRS.movenext
 loop

*/code*

Bei "case 4" wird die Tabelle fuer das Bild und die Bildunterschrift definiert, die Tabellenbreite wird festgelegt, das Bild in die erste <tr><td> geschrieben und dann mit </td></tr> geschlossen und die naechste Schleife bringt (defaultmaessig) die dazugehoerige Bildunterschrift: das bedeutet dann "case 5" und fuer besagte Bildunterschrift wird wieder eine Reihe (<tr>) und eine Zelle (<td>) geoeffnet bevor die Tabelle geschlossen wird </td></tr></tabel>.

Das Problem ist nun folgendes: Wenn die Bildunterschrift laenger ausfaellt als das Bild breit ist, bricht der Text nicht um.. Durch die Schleife fuehrt das irgendwie zur Nichtberuecksichtigung: Wer hat mir einen Tipp woran das liegen koennte?!

Vielen Dank.