Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a rule?

Status
Not open for further replies.

LaPluma

Programmer
Feb 3, 2002
139
DE
Hello

I have a page here:


which is a result of this:


<%@language=vbscript%>

<%
Option Explicit

Dim ConnectionString
Dim connObj
Dim sql
Dim oRS

ConnectionString=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & Server.MapPath(&quot;\stevehigham\db\testDB.mdb&quot;) & &quot;;&quot; & _
&quot;Persist Security Info=False&quot;

Set ConnObj = Server.CreateObject(&quot;ADODB.Connection&quot;)
connObj.Open ConnectionString

sql = &quot;select * from Table1&quot;
sql = &quot;SELECT girlSurname, girlFirst FROM Table1 ORDER BY girlSurname&quot;

Set oRS = connObj.Execute(sql)
Do While Not oRS.EOF
Response.Write(oRS(&quot;girlFirst&quot;) & &quot; - &quot; & oRS(&quot;girlSurname&quot;) & &quot;<br>&quot;)
oRS.MoveNext
Loop

oRS.Close
connObj.Close

Set oRS = Nothing
Set connObj = Nothing
%>

But I am writing to ask what is the rule (or rules) about inserting HTML tags to make the table of names more presentable?

For instance, if I wanted 12pt Tahoma red bold, or 8pt orange Times Roman against a pink background cell (well, who wouldn't??!!), where do I insert these commands? Do I insert them after the Response.Write statement? And are they in brackets or quotation marks (or both)?

Thanks

LaPluma
 
Apart from the names above not being in tables...

If the same design applies across the whole table then set in the table tag e.g.

<TABLE cellspacing=&quot;1&quot; cellpadding=&quot;2&quot; STYLE=&quot;font-family: Arial; font-size: 8pt;&quot;>

If you want to specify each cell or row then you have to specify it in each <TD> e.g.
<TD bgcolor=&quot;#F4F1EC&quot; style=&quot;font-weight: bold; font-size:8pt&quot;>

If as in the page you have above you would do something as such ...
<Font size=2 face=arial color=&quot;#800000&quot;>Response.write &quot;Hello&quot;</FONT>

I dont think you set the background colour on just text, would have to be placed into a table as above example Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Hello Gary

Thanks for your message.

I have tried the following:

<TABLE cellspacing=&quot;1&quot; cellpadding=&quot;2&quot; STYLE=&quot;font-family: Verdana; font-size: 8pt;&quot;>Response.Write(oRS(&quot;girlFirst&quot;) & &quot; - &quot; & oRS(&quot;girlSurname&quot;) & &quot;<br>&quot;)</table>

but it generates an 'Expected Statement' error.

Perhaps that's not what you meant?

LaPluma
 
I did miss some tags out in the post ...I'll take the code you have above and to create the table you want it should look something like this

<TABLE cellspacing=&quot;1&quot; cellpadding=&quot;2&quot; STYLE=&quot;font-family: Verdana; font-size: 8pt;&quot;>
<%
Do While Not oRS.EOF
%>
<TR><TD><%=oRS(&quot;girlFirst&quot;)%></TD><TD><%=oRS(&quot;girlSurname&quot;)%></TD></TR>
<%
oRS.MoveNext
Loop
%>
</TABLE> Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top