Hvordan fjerner jeg den nederste border i den sidste rækker der skrives ud ??? ----------------------------------------------------------------- <% intPage = 1 %> <!--#include virtual="/inc/command.inc"--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head></head> <body> <table cellspacing="0" cellpadding="0" height="134" style=""> <% Set rs1 = Server.CreateObject("ADODB.RecordSet") SQL = "SELECT Top 15 * FROM tb_Shops" rs1.Open SQL, Conn, 1 If Not (rs1.BOF Or rs1.EOF) Then rs1.PageSize = 500 rs1.AbsolutePage = intPage intRecCount = rs1.PageSize intPageCount = rs1.PageCount noPrRow = 0 maxPrRow = 5
Do While Not rs1.EOF And intRecCount > 0 '--------------------------------------------------------------------- If noPrRow = 0 Then %> <tr style="background-color: #ffffff;"> <% End If %> <td width="133" height="134" style="border-bottom: 4px solid #694434;<% If Not noPrRow = maxPrRow - 1 Then %>border-right: 4px solid #694434;<% End If %> cursor: hand;"> </td> <% noPrRow = noPrRow + 1 If noPrRow = maxPrRow Then Response.Write "</tr>" noPrRow = 0 End If intRecCount = intRecCount - 1 rs1.MoveNext Loop End If If noPrRow > 0 Then Response.Write "</tr>" %> </table> </body> </html> -----------------------------------------------------------------
Ok rent faktisk så er det denne kode: ------------------------------------------------------------------------------------------------------------------------------- <table cellspacing="0" cellpadding="0" height="134" style=""> <% CountSQL = "SELECT COUNT(ShopID) AS ShopCount FROM tb_Shops" Set rsCount = Conn.Execute (CountSQL) TotalItems = rsCount("ShopCount") TotalRowNum = TotalItems / 5 TotalRowNum = left(TotalRowNum,1)
SQL = "SELECT * FROM tb_Shops" Set rs1 = Conn.Execute (SQL) If Not (rs1.BOF Or rs1.EOF) Then noPrRow = 0 maxPrRow = 5
Do While Not rs1.EOF '--------------------------------------------------------------------- UploadPath = Request.ServerVariables("APPL_PHYSICAL_PATH")&"images\uploaded\" ImgFile = "shop_"&rs1("ShopID")&"_logo" set fs=Server.CreateObject("Scripting.FileSystemObject") If fs.FileExists(UploadPath&ImgFile&".gif") then img="ok" imgname = ImgFile&".gif" ElseIf fs.FileExists(UploadPath&ImgFile&".jpg") then img="ok" imgname = ImgFile&".jpg" End If If noPrRow = 0 Then %> <tr style="background-color: #ffffff;"> <% End If %> <td width="133" height="134" style="<% If intRowNum <= CInt(TotalRowNum) Then %>border-bottom: 4px solid #694434;<% End If %><% If Not noPrRow = maxPrRow - 1 Then %>border-right: 4px solid #694434;<% End If %> cursor: hand;" onClick="location.href='./?catid=<%= rs1("ShopID") %>'"><% If imgname <> "" Then %><img src="/images/uploaded/<%= imgname %>" width="133" height="134" alt=""><% Else %> <% End If %></td> <% noPrRow = noPrRow + 1 If noPrRow = maxPrRow Then Response.Write "</tr>" noPrRow = 0 intRowNum = intRowNum + 1 End If intRecCount = intRecCount - 1 rs1.MoveNext Loop End If If noPrRow > 0 Then Response.Write "</tr>" %> </table>-------------------------------------------------------------------------------------------------------------------------------
ok, kl. er 6 og jeg er mega træt. Jeg bliver ved med at poste den forkerte kode :) Damn... Ok.. Her kommer den rigtige kode. uden pis :) -------------------------------------------------------------------------------------------------------------------------------- <table cellspacing="0" cellpadding="0" height="134" style=""> <% SQL = "SELECT * FROM tb_Shops" Set rs1 = Conn.Execute (SQL) If Not (rs1.BOF Or rs1.EOF) Then noPrRow = 0 maxPrRow = 5
Do While Not rs1.EOF '--------------------------------------------------------------------- If noPrRow = 0 Then %> <tr style="background-color: #ffffff;"> <% End If %> <td width="133" height="134" style="border-bottom: 4px solid #694434;<% If Not noPrRow = maxPrRow - 1 Then %>border-right: 4px solid #694434;<% End If %> cursor: hand;"> </td> <% noPrRow = noPrRow + 1 If noPrRow = maxPrRow Then Response.Write "</tr>" noPrRow = 0 End If rs1.MoveNext Loop End If If noPrRow > 0 Then Response.Write "</tr>" %> </table> --------------------------------------------------------------------------------------------------------------------------------
Den if, du har omkring border-right kan du vel pakke din border-bottom ind i også? (Det ville måske værer pænt med en else-del, der sætter border="0" ??)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.