Connecting Tech Pros Worldwide Forums | Help | Site Map

to display string in vertical order in ASP

Member
 
Join Date: Jul 2008
Posts: 43
#1: 3 Weeks Ago
I want to display a string like GOOGLE in following format:
G
O
O
G
L
E

Please guide.

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,168
#2: 3 Weeks Ago

re: to display string in vertical order in ASP


You can do this using CSS if you want to.

Place the text into a <div> or a <span> (with a style of display:block) and set the width to the same width of 1 character. Put spaces in between the characters in the string. This will display each character on it's own line....

For example:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.   <title>Verticle Text</title>
  5.   <style type="text/css">
  6.     /*<![CDATA[*/
  7.     .verticle{
  8.       width:10px; 
  9.       padding:0;
  10.       font-size:1.4em; 
  11.       font-family:georgia, "times new roman", serif;
  12.     }
  13.     /*//]]>*/
  14.   </style>
  15. </head>
  16. <body>
  17.   <div id="TextSpace" class="verticle">
  18.     G O O G L E
  19.   </div>
  20. </body>
  21. </html>
-Frinny
GazMathias's Avatar
Expert
 
Join Date: Oct 2008
Location: Bristol, United Kingdom
Posts: 145
#3: 3 Weeks Ago

re: to display string in vertical order in ASP


Another (VBScript) way:

Expand|Select|Wrap|Line Numbers
  1. function vertString(string)
  2. dim temp
  3.  
  4. temp = "<p>"
  5.  
  6. for i = 1 to len(string)
  7.   temp = temp & mid(string,i,1) & "<br />"
  8. next
  9.  
  10. vertString = temp & "</p>"
  11.  
  12. end function
  13.  
  14. response.write vertString("Some text to display vertically!")
  15.  
Gaz
Member
 
Join Date: Jul 2008
Posts: 43
#4: 5 Days Ago

re: to display string in vertical order in ASP


Thanks Frinny!!!
But I need this format in ASP not in HTML
GazMathias's Avatar
Expert
 
Join Date: Oct 2008
Location: Bristol, United Kingdom
Posts: 145
#5: 4 Days Ago

re: to display string in vertical order in ASP


Hi

Did you miss my post, above?

Gaz
Reply