Results 1 to 2 of 2

Thread: Making table colums wider

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    Making table colums wider

    I have the following code on my asp page. What happens is that data is retrieved from a DB and put in a table, what i would like to know is how can i get the Quote colmn to be about 350pixles and the Author about 150pixles.


    <%
    Option Explicit
    Response.Expires = -1000

    Dim oConn
    Dim oRS
    Dim sSQL
    Dim sColor

    Dim myDate
    Dim nDate
    mydate = Date()
    nDate = Month(myDate) & "/" & Day(myDate)

    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\Quotes.mdb"))

    sSQL = "SELECT Date, TodaysQuote, Author FROM Quotes WHERE Date = '" & nDate & "'"
    Set oRS = oConn.Execute(sSQL)

    Response.Write("<table border=1 cellpadding=1 cellspacing=1 style='font-family:arial; font-size:10pt;'>")
    Response.Write("<tr bgcolor=black style='color:white;'></tr>")

    sColor = "white"

    Do While NOT oRS.EOF


    If sColor = "silver" Then
    sColor = "white"
    Else
    sColor = "silver"
    End If

    Response.Write("<tr bgcolor='" & sColor & "'>")
    Response.Write("<td>" & oRS("TodaysQuote").Value & "</td>")
    Response.Write("<td align=left>" & oRS("Author").Value & "</td></tr>")

    oRS.MoveNext

    Loop

    Response.Write("</table><br><br>")

    oConn.Close
    Set oRS = Nothing
    Set oConn = Nothing

    %>

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Use the width=nnn attribute of the TD would be the most direct way:
    Code:
    Response.Write("<td width=350>" & oRS("TodaysQuote").Value & "</td>") 
    Response.Write("<td align=left width=150>" & oRS("Author").Value & "</td></tr>")
    cudabean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width