473,836 Members | 1,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to avoid space trimming in HTML

33 New Member
Hi,

I have a search page in which I take data from a recordset. Some data which is retrieved may have more than one space between 2 words. But in my result page, HTML is truncating those spaces into single space and displays the result. But I need it as it is in the database. Is there any way similar to &nbsp which can be applied to this situation? My code is as follows:

<TD nowrap borderColor=mar oon width="180"><FO NT size=3><%=rs(0) %></FONT></TD>
in which rs(0) is the field containing spaces.

Plz help me..

Thanks in advance

Matsam
Aug 30 '07 #1
4 1912
nedu
65 New Member
Hi,

You shall use the following code to allow spaces while accessing the DB.

Response.Write "<PRE><font face=monospace size=10>" & Rs.Fields(0) & "</font></PRE>"

Let me know for any other queries . . .

Regards,
Nedu. M
Aug 30 '07 #2
Matsam
33 New Member
Hi,

You shall use the following code to allow spaces while accessing the DB.

Response.Write "<PRE><font face=monospace size=10>" & Rs.Fields(0) & "</font></PRE>"

Let me know for any other queries . . .

Regards,
Nedu. M

Hi,

Thanks for your help. But I'm sorry, my problem still remains open...
Actually I want to take records from a table and populate it into a combo box. The <PRE> tag is not working in this case.. Other situations it is ok. Following is my code:

<SELECT id=select4 style="WIDTH: 256px; HEIGHT: 22px"
name=lstSubject >
<% do while not rs3.EOF %>
<OPTION > <PRE> <%=rs3(0) %> </PRE> </OPTION>

<% rs3.MoveNext
loop
rs3.close %>

</SELECT>

where rs3 is my recordset.

Here nothing happens on including <PRE> tag.

Pls help..

Thanks again

Matsam
Aug 31 '07 #3
nedu
65 New Member
Hi Mastam,

Use the following code

<Select>
<%
While Not Rs.EOF
Txt = Replace(rs.Fiel ds(0)," ", "&nbsp;")

%>
<option value="<%=Txt%> "><%= Txt %></option>
<%
Rs.MoveNext
wend
%>

</Select>

Let me know for any other queries.

Regards,
Nedu . M
Aug 31 '07 #4
Matsam
33 New Member
Hi Mastam,

Use the following code

<Select>
<%
While Not Rs.EOF
Txt = Replace(rs.Fiel ds(0)," ", "&nbsp;")

%>
<option value="<%=Txt%> "><%= Txt %></option>
<%
Rs.MoveNext
wend
%>

</Select>

Let me know for any other queries.

Regards,
Nedu . M
Hi Nedu,

Thanks a lot for ur help. Now my problem is solved.
Thanks again...

Regards
Matsam
Sep 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1887
by: shank | last post by:
I'm querying a text field with an 8000 character limit. The text also contains HTML tags like <p> <br> and more. Is there a way to strip all HTML tags in the resulting recordset, or do I have to replace each tag individually? thanks
3
4664
by: |-|erc | last post by:
Yes No ? Herc -- >>add this link to your sig for $5 a month<< I chat at www.YeOldeCoffeeShoppe.com
3
2129
by: Wim Roffal | last post by:
HTML leaves standard a lot of space below a form. Is there a possibility to remove this space so that it can be used for other purposes? Thanks, Wim
4
1764
by: Aaron | last post by:
is there a way to remove all white spaces in the html output? ie. everything as one line.
8
11701
by: Stanley | last post by:
The following HTML works as expected in IE6 and IE7, but in Firefox, there is extra space below the image. I tried setting margin and padding to 0 for different elements but still cannot get rid of it. Any idea what causes the space? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
1
1350
by: 418928 | last post by:
Hi everybody, I would like to know if there is some trick to avoid loading an HTML page again is it is already loaded in another browser tab. In that case, instead of loading the page again, I would just like to direct the user to the right tab automatically. Maybe this can be done with Javascript using an intermediate html page with the appropriate Javascript code... Note: I will have an applet on that page and I want to avoid...
4
3583
Frinavale
by: Frinavale | last post by:
I am so frustrated with IE7 right now. I have a JavaScript class that dynamically generates the HTML for a client-side tab control based on the some JSON Objects that I created server side. The JavaScript generates a table with one row in it, where each <td> is a tab. Right now the style for the table is as follows: display:inline-table; height:100%; margin: 0px; padding:0px;
4
3255
by: lesterhawkins | last post by:
When I create an html web page with tables, the space between the tables is correct when I look at the web page in Firefox, but incorrect when I look at the web page in IE. I have put an example of this in: http://www.doug-long.com/atest.htm . The third paragraph is in its correct position in Firefox but is pushed off to the side in IE. How can I code so the tables are the same distance apart in both Firefox and IE? (I have Firefox...
0
9813
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10584
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10248
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6976
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5815
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3108
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.