PDA

Click to See Complete Forum and Search --> : Making table colums wider


mrstuff68
May 31st, 2002, 11:41 PM
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

%>

Cudabean
Jun 1st, 2002, 01:34 AM
Use the width=nnn attribute of the TD would be the most direct way:

Response.Write("<td width=350>" & oRS("TodaysQuote").Value & "</td>")
Response.Write("<td align=left width=150>" & oRS("Author").Value & "</td></tr>")


cudabean