to display string in vertical order in ASP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raman Pahwa
    New Member
    • Jul 2008
    • 43

    to display string in vertical order in ASP

    I want to display a string like GOOGLE in following format:
    G
    O
    O
    G
    L
    E

    Please guide.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title>Verticle Text</title>
      <style type="text/css">
        /*<![CDATA[*/
        .verticle{
          width:10px; 
          padding:0;
          font-size:1.4em; 
          font-family:georgia, "times new roman", serif;
        }
        /*//]]>*/
      </style>
    </head>
    <body>
      <div id="TextSpace" class="verticle">
        G O O G L E
      </div>
    </body>
    </html>
    -Frinny

    Comment

    • GazMathias
      Recognized Expert New Member
      • Oct 2008
      • 228

      #3
      Another (VBScript) way:

      Code:
      function vertString(string)
      dim temp
      
      temp = "<p>"
      
      for i = 1 to len(string)
        temp = temp & mid(string,i,1) & "<br />"
      next
      
      vertString = temp & "</p>"
      
      end function
      
      response.write vertString("Some text to display vertically!")
      Gaz

      Comment

      • Raman Pahwa
        New Member
        • Jul 2008
        • 43

        #4
        Thanks Frinny!!!
        But I need this format in ASP not in HTML

        Comment

        • GazMathias
          Recognized Expert New Member
          • Oct 2008
          • 228

          #5
          Hi

          Did you miss my post, above?

          Gaz

          Comment

          Working...