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

Multi Column Select

Status
Not open for further replies.

Norman55

Programmer
Apr 27, 2006
48
GB
I am trying to make a select box have 2 values from a RecordSet
i have managed to do this but i am having trouble spacing the columns evenly

i have tried to force the length of the first column but can only do this by inserting a chacator not spaces? Can anybody help me put spaces in or point me in a different direction.

Group=mid(myRS("title"),4,50)
Des =myRs("Description")

length = len(group)
MaxLength = "15"
Result = maxlength - length

Response.Write "<option value = '" & title & "'>"
Response.Write Group
response.Write string(result,"*")
response.Write des
 
Try using &nbsp;'s and set the font using CSS to a monospace font:
Code:
<%
Dim arr: arr = Array("red","blue","green");
Dim i

Response.Write "<select name=""selColor"" style=""font-family: monospace;"">"
For i = 0 to UBound(arr)
   Response.Write "<option>"
   Response.Write Replace(Left(arr(i) & String(20," "),20)," ","&nbsp;")
   Response.Write i
   Response.Write "</option>"
Next
Response.Write "</select>"

I apologize for any syntactical error, been writing more PHP and C# recently than VBScript.

-T

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top