2 tags inside alignment td

I have 2 shortcuts inside td and I'm trying to make the alignment work

Is it possible?

Here is a script for the same explanatory problem and the way I need it.

jsFiddle

<tr> <td><label >Some Label Test:</label><label>Some Label Test:</label></td> <td> <label >Some Label Test:</label> <label >here is the long test which exceeds the width and comes to second line but i want it like it should start below after test: instaead from some</label></td> </tr> 

We are looking for a second mark inside, if the length is long, it goes to the next line and starts from the beginning of the second mark.

+4
source share
2 answers

Here is a simple use of the div, how to get what you want. http://jsfiddle.net/KHAJz/3/

HTML

 <div class="container"> <div class="first">Some Label Test:</div> <div class="first">Some Label Test:</div> <div class="first">Some Label Test:</div> <div class="text">here is the long test which exceeds the width and comes to second line but i want it like it should start below after test: instead </div> </div> 

CSS

 .container{ width:700px; height:60px; display:inline-block; } .first{ width:60px; height:60px; display:inline-block; float:left; } .text{ width:300px; display:inline-block; float:left; } 

What you do is make a container that contains everything together so that tables or divs don't get everywhere.

+1
source

If you don't want (or can't) change your DOM, just add this to your CSS

 label { display: inline-block; height: 100%; } 

See working script

But if you can change your DOM, I would recommend that you leave the table layout and restore the layout using div s. as Kate answers.

0
source

All Articles