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

Fixed length font

Status
Not open for further replies.

sqlwp

Programmer
Joined
Jan 23, 2004
Messages
24
Location
US
I'm displaying data on an asp page from information entered through an MS Access form. The spacing of the text in Access looks good, for example:
This is line 1 text:
This is line 2...........123
This is line three.......125
But when I display it on the asp page the font is different and skews the text display. If I change the font on the Access form to a fixed length, like courier, and use the pretag in asp it will display it correctly but this would be a major undertaking to re-type all the text.
Is there any other way of dealing with this?
 
1) You are bound to the display possibilities of HTML. 2) You normally do not know which browser(version) your audience is using and 3) which fonts are installed on their PC's and 4) which screen resolution they have.

I presume you want 2 nice columns:
<table>
<tr><td>This is line 1 text:</td><td align=right></tr>
<tr><td>This is line 2</td><td align=right>123</td></tr>
<tr><td>This is line three</td><td align=right>125</td></tr>
</table>




hth,
Foxbox
ttmug.gif
 
That's exactly what I want but I have no way of telling what part of the text needs to be tabled.
 
replace the CrLf with breaks:


response.write &quot;<pre>&quot;
response.write replace( rs(&quot;textfield&quot;) , vbCrLf, &quot;<br>&quot;)
response.write &quot;</pre>&quot;


hth,
Foxbox
ttmug.gif
 
Unfortunately they don't have any Crlf's in their text.
Thank you all for your input.
 
mmmmm, strange. i do not use access, but i presume that each line in a textfield ends with CR/LF. vbCrLF should work then. You could try:

replace( rs(&quot;textfield&quot;), chr(13) & chr(10), &quot;<br>&quot;)

It is also possible that only a chr(10) character is at the end of the line. So try also:

replace( rs(&quot;textfield&quot;), chr(10) , &quot;<br>&quot;)



[where is my hex editor?]





hth,
Foxbox
ttmug.gif
 
Mmm is your data in a TEXT field or in a MEMO field? My Multi-Edit shows 0D 0A at the end of a line in MEMO fields, so replace( rs(&quot;textfield&quot;), chr(13) & chr(10), &quot;<br>&quot;) should work.
If your data is in a TEXT field then this:
This is line 1 text:
This is line 2...........123
This is line three.......125
is the info from 3 records?


hth,
Foxbox
ttmug.gif
 
The text is typed into a text box. The form field wraps the text to it's size so the user doesn't put in carriage returns until they get to a part where they want special formatting. So the lines with special formatting like below have returns but the rest of the text in the field doesn't:
This is line 1 text:
This is line 2...........123
This is line three.......125
 
i see no other alternative than to change the fieldtype into MEMO. Make the (Access) input box large enough, so users start to enter CrLf's.

hth,
Foxbox
ttmug.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top