Adding a tab character to a drop down

G

Guest

Hi there

Anyone know the syntax in ASP that shows 2 values in a drop down combo with
a tab between them

I have tried:

<option value=<%= rstT.fields("pcode")%>><%= rstT.fields("pcode") & vbTab &
rstT.fields("pdesc") </option>

<option value=<%= rstT.fields("pcode")%>><%= rstT.fields("pcode") & <Tab> &
rstT.fields("pdesc") </option>

<option value=<%= rstT.fields("pcode")%>><%= rstT.fields("pcode") & "vbTab"
& rstT.fields("pdesc") </option>

I can't seem to find the correct syntax anywhere.

I want the results to read...with the descriptions lined up

1 Corporate
10 Corporate & Commercial

but am getting ...

1 Corporate
10 Corporate & Commercial

Thanks
GwenP
 
M

Mark Rae [MVP]

Anyone know the syntax in ASP that shows 2 values in a drop down combo
with
a tab between them

One of the most important things to remember about ASP.NET (or any similar
technology) is that, no matter how clever it is, when all is said and done,
its fundamental job is to stream HTML down to a client browser in response
to a request from that client browser...

Generally speaking, the tab character is completely ignored by HTML
rendering engines, and will be treated simply as white space, so there is no
point in rendering a tab character to be streamed to the client browser - it
will simply be ignored...

Pretty much your only option with something like this is to use non-breaking
space characters i.e. &nbsp; - of course, you'll have to calculate how many
you need, and remember that non-proportionally-spaced fonts are always going
to mess these things up a little bit...
 
G

Guest

Hi there

Anyone know the syntax in ASP that shows 2 values in a drop down combo with
a tab between them

I have tried:

<option value=<%= rstT.fields("pcode")%>><%= rstT.fields("pcode") & vbTab &
rstT.fields("pdesc") </option>

<option value=<%= rstT.fields("pcode")%>><%= rstT.fields("pcode") & <Tab> &
rstT.fields("pdesc") </option>

<option value=<%= rstT.fields("pcode")%>><%= rstT.fields("pcode") & "vbTab"
& rstT.fields("pdesc") </option>

I can't seem to find the correct syntax anywhere.

I want the results to read...with the descriptions lined up

1 Corporate
10 Corporate & Commercial

but am getting ...

1 Corporate
10 Corporate & Commercial

Thanks
GwenP

Look at the following post, hope it helps
http://blogs.madtechnology.net/blogs/chris/archive/2003/10/23/255.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top