PDA

View Full Version : syntax question


gcapp
10-10-2002, 12:27 AM
I have this code:

Response.Write("<p><table border=0 cellspacing=0 cellpadding=0 width=550>" & vbCR)
Response.Write(" <tr style=""font-family: Arial; font-size:x-small;"">" & vbCR)
Response.Write(" <td width=99>" & "ID:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("ID") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Event Name:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Event_Name") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Location:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Location") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "City:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("City") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "State:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("State") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Zip Code:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Zip_Code") & "</td>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Description:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Description") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Start Date:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Start_Date") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "End Date:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("End_Date") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Time:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Time") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Phone:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Phone") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Website:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Website") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Email:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("Email") & "</td>" & "</tr>" & vbCR)
Response.Write(" <tr>" & "<td width=99>" & "Event Image:" & "</td>" & vbCR)
Response.Write(" <td width=437>" & RecordSet.Fields("event_image") & "</td>" & "</tr>" & vbCR)

'-- display the edit and delete links
Response.Write(" <tr>" & "<td width=99><a href='edit-events.asp?ID=" & RecordSet.Fields("ID") & "'>Edit</a> / <a href='view-events.asp?Action=Delete&ID=" & RecordSet.Fields("ID") & "'>Delete</a></td>" & vbCR)
Response.Write("</tr>" & vbCR)

The code in bold is what I want to use for the entire display. Right now only the "ID" line shows Arial and small font.

How can I change the code so the entire display will show Arial and small font size, without inserting it into every line?

Thanks

whammy
10-10-2002, 02:04 AM
First of all, you should DEFINITELY visit:

http://www.w3schools.com/css

(not to mention http://www.w3schools.com/asp)

all you need to do is put a style definition in between your head tags... like:

<style type="text/css">
<!--
td{
font-family: Arial, Helvetica;
font-size:8pt;
}
-->
</style>

I used td because it makes more sense than tr to me, at any rate.

I would recommend that everyone have a solid understanding of at least XHTML and CSS (not to mention javascript) before taking on ASP or PHP (or any other server-side scripting language).

Secondly, please don't repost the same question again. This belonged in your other syntax post. But since I answered it here, I'll close the other one.