473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

text in anticlockwise manner inside a td

Hello,
I want to write my text in anticlockwise manner inside a <td> of table.
I want my text not like this "TEST" but in this manner
T
E
S
T
in a <td> of a table.
I am sending you my code

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>test page for text in anticlockwise manner</title>
  4. </head>
  5. <body>
  6. <div>
  7. <table width=100 height=100>
  8. <tr>
  9. <td bgcolor=red>TEST</td> //// In this column i want that test to be as i mentioned above
  10. <td>
  11.     <table bgcolor=gray>
  12.         <tr>Add title1</tr>
  13.         <tr>Add title2</tr>
  14.         <tr>Add title3</tr>        
  15.         <tr>Add rules</tr>
  16.         <tr>discard rules</tr>
  17.     </table>
  18. </td>
  19. </tr>
  20. </table>
  21. </body>
  22. </html>
Nov 29 '07 #1
6 1440
gits
5,390 Expert Mod 4TB
hi ...

have a look at the following example :)

[HTML]<html>
<head>
<script type="text/javascript">

function handle_txt() {
var cell = document.getElementById('my_cell');
var txt = cell.innerHTML.split('');

cell.innerHTML = txt.join('<br/>');

}

</script>
</head>

<body onload="handle_txt();">
<table>
<tr>
<td bgcolor="red" id="my_cell">TEST</td>
</tr>
</table>
</body>
</html>
[/HTML]
kind regards
Nov 29 '07 #2
hi ...

have a look at the following example :)

[HTML]<html>
<head>
<script type="text/javascript">

function handle_txt() {
var cell = document.getElementById('my_cell');
var txt = cell.innerHTML.split('');

cell.innerHTML = txt.join('<br/>');

}

</script>
</head>

<body onload="handle_txt();">
<table>
<tr>
<td bgcolor="red" id="my_cell">TEST</td>
</tr>
</table>
</body>
</html>
[/HTML]
kind regards


Thanks,
Your code is working perfectly which i wanted.
I have another requirement.
I have dynamically created a td in a table. Now i want to put that text in the column. But this is not working. I am adding my code below

Expand|Select|Wrap|Line Numbers
  1. function handle_txt()
  2. {
  3.   var text="TEST";
  4.   txt=text.split('');
  5.   result=txt.join("<br/>");
  6.   return result;
  7. }
  8.  
  9. text=handle_txt;
  10. var tbl=document.createElement('table');
  11. var row=document.createElement('tr');
  12. var col1=document.createElement('td');
  13. var col2=document.createElement('td');
  14. col1.appendChild(text);
  15. //rest is how to add row,col to table
Nov 30 '07 #3
gits
5,390 Expert Mod 4TB
hi ...

when appending text you should use to set innerHTML or createTextNode(); with it and then append that node ... that should do the trick ...

kind regards
Nov 30 '07 #4
hi ...

when appending text you should use to set innerHTML or createTextNode(); with it and then append that node ... that should do the trick ...

kind regards
can you please help me out how i have to write.
I have already sent my code.
Dec 3 '07 #5
gits
5,390 Expert Mod 4TB
hi ...

try the following:

Expand|Select|Wrap|Line Numbers
  1. col1.innerHTML = text;
instead of:

Expand|Select|Wrap|Line Numbers
  1. col1.appendChild(text);
  2.  
kind regards
Dec 3 '07 #6
hi ...

try the following:

Expand|Select|Wrap|Line Numbers
  1. col1.innerHTML = text;
instead of:

Expand|Select|Wrap|Line Numbers
  1. col1.appendChild(text);
  2.  
kind regards
Thanks
It is working perfectly.
Dec 3 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dekern | last post by:
I have been trying to set the default text value of a TextArea element for about a day now without any luck. Similar to the code used to set the Text field below I would like to use the returned...
3
by: Emil Dotchevski | last post by:
I have a table that is at 100% width, which contains a <TD> that is 80% of that. In the <TD> I want to put pre-formatted text (the output from a C++ compiler, to be more precise) and I'd like the...
7
by: miked | last post by:
Hi, On a webpage I'm authoring I'm having a problem with setting the text background colour. I'm using this: P {color ="FFFFFF"; background-color:"000000"; font-size:10pt; font-family:...
8
by: Jakej | last post by:
I've been using a javascript in an html file for a banner slider, and it works as desired. But I'd like to use it on more than one page and it would be great if I could transfer the code to a .js...
1
by: johngilmer | last post by:
I have three radio buttons that are possible answers to a question. I have put them in a table and there is a label that goes with each radio button as its text. I would like to make some of the...
7
by: pbd22 | last post by:
Hi. Can somebody tell me how I would go about allowing the user to click on a link to put content in text box A and then another link to put different content in text box A and so on. Finally,...
0
by: suprodeep | last post by:
have a page for admin(admin.aspx). This would enter product name, image, category name and and long description in a formatted manner. The prod name, image, category name can be inputted to...
5
by: linuxx | last post by:
Hello Guys, If I rotate 2D array anticlockwise,how would I map original variables into new matrix? Consider the example: original matrix = 1 2 3 4 5 6 7 8 9
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.