Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   html select's option tag's display (http://www.velocityreviews.com/forums/t758990-html-selects-option-tags-display.html)

TS 04-30-2008 02:48 PM

html select's option tag's display
 
i have a DDL that i am allowing its content to not be html encoded. my goal
is to have each option tag with formatted spacing so that it appears to be 2
columns in the drop down list. i cannot do spaces or other characters to get
this spacing becuase the with of spacing is not the same from option to
option. i would like it to look like this so the list is visibly readable:

11234 Equipment
313452 Tools
133 Cars


Any help is appreciated,
thanks



TS 04-30-2008 07:52 PM

Re: html select's option tag's display
 
to reiterate, i have tried simple   for spacing but the width taken up
by the space is not the same as the width for a character, so alignment is
not achieved (i have tried <pre> tag but it is isgnored)


"TS" <manofsteele1@nospam.nospam> wrote in message
news:%232Af5EtqIHA.3900@TK2MSFTNGP05.phx.gbl...
>i have a DDL that i am allowing its content to not be html encoded. my goal
>is to have each option tag with formatted spacing so that it appears to be
>2 columns in the drop down list. i cannot do spaces or other characters to
>get this spacing becuase the with of spacing is not the same from option to
>option. i would like it to look like this so the list is visibly readable:
>
> 11234 Equipment
> 313452 Tools
> 133 Cars
>
>
> Any help is appreciated,
> thanks
>




Steven Cheng [MSFT] 05-01-2008 02:43 AM

Re: html select's option tag's display
 
Hi TS,

From your description, you're using an html <select> list to display some
text data list. Since each select option will display two data field,
you're looking for a way to better format the options so that those options
are aligned correctly(like table) vertically, correcct?

Regarding on this issue, I've performed some tests. It seems the <select>
list's <option> item is quite limited that we can add little inner html to
format the text in it. At least, html <table> cannot be used in <option>.
I've also tried using <div>, it can be embeded into it, however, setting
the width also not quite work. I'm thinking whether we can do the length
formatting at data level. For example, for the data items you will bind to
the <select> list, it is possible that you format the text data before bind
to <select> list? For example, you can append html space (&nbsp;) to each
text so as to fill them as a fixed width?

Or you can look for some customized rich dropdownlist approach:

#Rich List Controls in ASP.NET
http://www.codeproject.com/KB/custom...tControls.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.


==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "TS" <manofsteele1@nospam.nospam>
>References: <#2Af5EtqIHA.3900@TK2MSFTNGP05.phx.gbl>
>Subject: Re: html select's option tag's display
>Date: Wed, 30 Apr 2008 14:52:44 -0500


>
>
>"TS" <manofsteele1@nospam.nospam> wrote in message
>news:%232Af5EtqIHA.3900@TK2MSFTNGP05.phx.gbl...
>>i have a DDL that i am allowing its content to not be html encoded. my

goal
>>is to have each option tag with formatted spacing so that it appears to

be
>>2 columns in the drop down list. i cannot do spaces or other characters

to
>>get this spacing becuase the with of spacing is not the same from option

to
>>option. i would like it to look like this so the list is visibly readable:
>>
>> 11234 Equipment
>> 313452 Tools
>> 133 Cars
>>
>>
>> Any help is appreciated,
>> thanks
>>

>
>
>



TS 05-01-2008 02:39 PM

Re: html select's option tag's display
 
Thanks, i was able to get the alignment to work using &nbsp; and a monospace
font (courier)

"Steven Cheng [MSFT]" <stcheng@online.microsoft.com> wrote in message
news:Cy3sbUzqIHA.1788@TK2MSFTNGHUB02.phx.gbl...
> Hi TS,
>
> From your description, you're using an html <select> list to display some
> text data list. Since each select option will display two data field,
> you're looking for a way to better format the options so that those
> options
> are aligned correctly(like table) vertically, correcct?
>
> Regarding on this issue, I've performed some tests. It seems the <select>
> list's <option> item is quite limited that we can add little inner html to
> format the text in it. At least, html <table> cannot be used in <option>.
> I've also tried using <div>, it can be embeded into it, however, setting
> the width also not quite work. I'm thinking whether we can do the length
> formatting at data level. For example, for the data items you will bind
> to
> the <select> list, it is possible that you format the text data before
> bind
> to <select> list? For example, you can append html space (&nbsp;) to each
> text so as to fill them as a fixed width?
>
> Or you can look for some customized rich dropdownlist approach:
>
> #Rich List Controls in ASP.NET
> http://www.codeproject.com/KB/custom...tControls.aspx
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
>
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> --------------------
>>From: "TS" <manofsteele1@nospam.nospam>
>>References: <#2Af5EtqIHA.3900@TK2MSFTNGP05.phx.gbl>
>>Subject: Re: html select's option tag's display
>>Date: Wed, 30 Apr 2008 14:52:44 -0500

>
>>
>>
>>"TS" <manofsteele1@nospam.nospam> wrote in message
>>news:%232Af5EtqIHA.3900@TK2MSFTNGP05.phx.gbl.. .
>>>i have a DDL that i am allowing its content to not be html encoded. my

> goal
>>>is to have each option tag with formatted spacing so that it appears to

> be
>>>2 columns in the drop down list. i cannot do spaces or other characters

> to
>>>get this spacing becuase the with of spacing is not the same from option

> to
>>>option. i would like it to look like this so the list is visibly
>>>readable:
>>>
>>> 11234 Equipment
>>> 313452 Tools
>>> 133 Cars
>>>
>>>
>>> Any help is appreciated,
>>> thanks
>>>

>>
>>
>>

>




Steven Cheng [MSFT] 05-02-2008 03:54 AM

Re: html select's option tag's display
 
Thanks for your reply TS,

I'm glad that you've found out your means to get the alignment working. If
there is anything else we can help later, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "TS" <manofsteele1@nospam.nospam>
>References: <#2Af5EtqIHA.3900@TK2MSFTNGP05.phx.gbl>

<upA$DvvqIHA.2068@TK2MSFTNGP05.phx.gbl>
<Cy3sbUzqIHA.1788@TK2MSFTNGHUB02.phx.gbl>
>Subject: Re: html select's option tag's display
>Date: Thu, 1 May 2008 09:39:17 -0500


>Thanks, i was able to get the alignment to work using &nbsp; and a

monospace
>font (courier)
>
>"Steven Cheng [MSFT]" <stcheng@online.microsoft.com> wrote in message
>news:Cy3sbUzqIHA.1788@TK2MSFTNGHUB02.phx.gbl...
>> Hi TS,
>>
>> From your description, you're using an html <select> list to display some
>> text data list. Since each select option will display two data field,
>> you're looking for a way to better format the options so that those
>> options
>> are aligned correctly(like table) vertically, correcct?
>>
>> Regarding on this issue, I've performed some tests. It seems the <select>
>> list's <option> item is quite limited that we can add little inner html

to
>> format the text in it. At least, html <table> cannot be used in <option>.
>> I've also tried using <div>, it can be embeded into it, however, setting
>> the width also not quite work. I'm thinking whether we can do the length
>> formatting at data level. For example, for the data items you will bind
>> to
>> the <select> list, it is possible that you format the text data before
>> bind
>> to <select> list? For example, you can append html space (&nbsp;) to each
>> text so as to fill them as a fixed width?
>>
>> Or you can look for some customized rich dropdownlist approach:
>>
>> #Rich List Controls in ASP.NET
>> http://www.codeproject.com/KB/custom...tControls.aspx
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> Delighting our customers is our #1 priority. We welcome your comments and
>> suggestions about how we can improve the support we provide to you.

Please
>> feel free to let my manager know what you think of the level of service
>> provided. You can send feedback directly to my manager at:
>> msdnmg@microsoft.com.
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>>

http://msdn.microsoft.com/subscripti...ult.aspx#notif
>> ications.
>>




All times are GMT. The time now is 09:56 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.