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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bold Text

Status
Not open for further replies.

cocopud

Technical User
Jan 8, 2002
139
0
0
US
Ok, I am not much of a programmer, but have a vbscript page which I believe is also using html. I need the first line in one particular area to be bold. I have searched and tried various tags, but nothing seems to work.
Below is the excerpts from the code. The 1st two lines are at the top of the page (more lines between them) then a bunch of pstrWrite lines and the msg_text line below needs to be bold for the first line that is printed, but not the remaining lines. Any help would be appreciated because I cannot seem to find anything that is working for me.
<%@ Language=VBScript %>
...
pstrWritetop = "<html>"

do while not adoRS.EOF
pstrWrite = pstrWrite & "<TR><TD><h2>" & adoRS("msg_title") & "<br></h2></font>"
pstrWrite = pstrWrite & adoRS("msg_text") & "</TD></TR>" & vbCrLf
adoRS.MoveNext
loop
 
[tt]
[blue]bbold=true[/blue]
do while not adoRS.EOF
pstrWrite = pstrWrite & "<TR><TD><h2>" & adoRS("msg_title") & "<br></h2></font>" [red]'<font>tag is unbalance=no good[/red]
if bbold then
pstrWrite = pstrWrite & [blue]"<span style=""font-weight:bold;"">"[/blue] & adoRS("msg_text") & "[blue]</span>[/blue]</TD></TR>" & vbCrLf
[blue]bbold=not bbold[/blue]
else
pstrWrite = pstrWrite & [blue]"<span style=""font-weight:normal;"">"[/blue] & adoRS("msg_text") & "[blue]</span>[/blue]</TD></TR>" & vbCrLf
end if
adoRS.MoveNext
loop
[/tt]
ps: [1] </font> appeared above would never have a balanced tag having nested tag which is never a good practice (besides, font tag is deprecated); [2] you can sure spare the span tag in case bbold is false (else part). It is there just for illustrative parallelism.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top