2

i am trying to transform text according as described below.

02 Matchday

to

0
2
M
a
t
c
h
d
a
y

my codes are given below.. the current result is not accurate as i want. Kindly suggest me.

table {border-collapse:collapse;}
 td span {display:block;}
.sideways {
 -webkit-transform: rotate(90deg); 
 -moz-transform: rotate(270deg);
 -ms-transform: rotate(270deg);
 -o-transform: rotate(270deg);
 transform: rotate(270deg);
}
/*put specifics here*/
table tr:nth-of-type(1) td:nth-of-type(1) {background-color:tomato;}
table tr:nth-of-type(1) td:nth-of-type(2) {background-color:red;}
table tr:nth-of-type(1) td:nth-of-type(3) {background-color:chocolate;}
table tr:nth-of-type(1) td:nth-of-type(4) {background-color:black;}
table tr:nth-of-type(1) td:nth-of-type(5) {background-color:grey;}
<table>
  <tr>
    <td rowspan="3"><span class="sideways">O2 Matchday</span></td>
  </tr>
  <tr>
    <td>My O2 for Windows</td>
  </tr>
  <tr>
    <td colspan="2">Blipdrop</td>
    <td>My O2 for business</td>
  </tr>
  
</table>
Gautam Jha
  • 1,445
  • 1
  • 15
  • 24

2 Answers2

2

You can try this: http://jsfiddle.net/lotusgodkk/GCu2D/1013/

CSS:

div {
    font-size: 20px;
    width: 15px;
    overflow: hidden;
    word-break: break-all;
    text-align: center;
}

HTML:

    <div>Sample Text</div>
K K
  • 17,794
  • 4
  • 30
  • 39
1

The desired result can be achieved by using

width: 10px;
word-wrap: break-word;

instead of

-webkit-transform: rotate(90deg);   
    -moz-transform: rotate(270deg);
    -ms-transform: rotate(270deg);
    -o-transform: rotate(270deg);
    transform: rotate(270deg);

Here is the working fiddle : Fiddle

-- Help :)

Community
  • 1
  • 1
Help
  • 1,156
  • 7
  • 11