?
Solved

Text Direction with CSS?

Posted on 2001-07-03
7
Medium Priority
?
1,289 Views
Last Modified: 2013-11-19
Instead of the text in a <td> going left to right, I want the text to go vertical, botton to top.  Is this possible?  I can't find it anywhere.

Any help is appreciated.

Thanks,

davidgky
0
Comment
Question by:davidgky
7 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 6249614
For IE5.5 only there is this on the Microsoft site:

http://msdn.microsoft.com/library/default.asp?URL=/library/en-us/dnie55/html/verticaltext.asp 

I have not tried it so I don't know if it works.

For everything else you either create a graphic or do this

H<br>e<br>l<br>l<br>o

to get

H
e
l
l
o

Cd&
0
 

Author Comment

by:davidgky
ID: 6249834
Thanks... I found that this morning, but our intranets users are setup using only IE 5.0.  I guess I'm stuck using images until we upgrade!

Thanks again,

davidgky
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6249948
I am afraid so. It is part of the move toward international language support.  The ability to do vertical is just a side effct of support for Japanese and Chinese.

Cd&
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:CJCraft
ID: 6252187
Microsoft has a new filter style that can resize, rotate, or reverse the content of the object by using matrix transformations. It is called the Matrix Filter.

Put the text you want displayed vertically in a div and apply the matrix filter to it and set it for 90 degrees and that will rotate everything, text, images, etc, in the div 90 degrees.

Pretty cool what you could do with this thing. It takes a little work but the example is easy to modify to suit your needs.

Example:
http://msdn.microsoft.com/workshop/samples/author/dhtml/filters/matrix.htm

Reference:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/Matrix.asp

It is a 5.5 IE only style.

Chris
0
 
LVL 1

Expert Comment

by:coreyti
ID: 6325646
Just for fun, and expanding on COBOLdinosaur's first comment... here are some functions (javascript, not css solution) that write text top-to-bottom, bottom-to-top, and right-to-left.

Getting the vertical text to appear to wrap at the appropriate points would be quite an additional feat, but these should be fine for short strings.

----------

<html>
<head>
     <title>none really</title>
     <script type="text/javascript">
     <!--
          function writeToptoBottom( preText ) {
               var postText = "";
               var splitText = preText.split( "" );
               
               for( var i = 0; i < preText.length; i ++ ) {
                    postText += splitText[i] + "<br>";
               }
               
               return postText;
          }
         
          function writeBottomtoTop( preText ) {
               var postText = "";
               var splitText = preText.split( "" );
               
               for( var i = preText.length - 1; i >= 0; i -- ) {
                    postText += splitText[i] + "<br>";
               }
               
               return postText;
          }
         
          function writeRighttoLeft( preText ) {
               // ofcourse <bdo dir="rtl"> would handle this one
               
               var postText = "";
               var splitText = preText.split( "" );
               
               for( var i = preText.length - 1; i >= 0; i -- ) {
                    postText += splitText[i];
               }
               
               return postText;
          }
     // -->
     </script>
</head>

<body>

<table cellpadding="10" cellspacing="0" border="0">
     <tr>
          <td>
               <script type="text/javascript">
               <!--
                    document.write( writeToptoBottom( "Hello there everybody!" ) );
               // -->
               </script>
          </td>
          <td>
               <script type="text/javascript">
               <!--
                    document.write( writeBottomtoTop( "Hello there everybody!" ) );
               // -->
               </script>          
          </td>
          <td>
               <script type="text/javascript">
               <!--
                    document.write( writeRighttoLeft( "Hello there everybody!" ) );
               // -->
               </script>          
          </td>
     </tr>
</table>

</body>
</html>

----------

-corey
0
 
LVL 2

Expert Comment

by:ramses
ID: 6423234
To display text vertically, use the LABEL object

Example:

<Html>
<head><title>Vertical text</title></head>
<body>
<OBJECT
CLASSID="clsid:99B42120-6EC7-11CF-A6C7-00AA00A47DD2"
ID=lbl1
WIDTH=40
HEIGHT=250
>
<PARAM NAME="angle" VALUE="90">
<PARAM NAME="alignment" VALUE="2">
<PARAM NAME="BackStyle" VALUE="0">
<PARAM NAME="caption" VALUE="Hello there">
<PARAM NAME="FontName" VALUE="Arial">
<PARAM NAME="FontSize" VALUE="30">
<PARAM NAME="FontBold" VALUE="1">
<PARAM NAME="frcolor" VALUE="8388608">
</OBJECT>
</body>
</html>

Since I noted that you use MSIE, you'll be just fine.  NS doesn't display the label, however

Maybe NS6 does?

Control textdirection with the angle property.  You can have it left to right, right to left, top to bottom, bottom to top... any angle is possible

Ramses says RooOOAar!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6616504
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to COBOLdinosaur
</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question