dojjol
asked on
align 2 spans in div horizontally
Hello All,
IS there a way I can align two spans with in between in a div to align horizontally
Thank you.
IS there a way I can align two spans with in between in a div to align horizontally
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
add a <br> after second column
Yes I would change it like this:
<div>
<span style="padding-right:2px;" >column1</ span>
<span>column2</span><br />
<span style="padding-right:2px;" >column3</ span>
<span>column4</span>
</div>
The spans will keep appending to the "row" that they are in. Once you insert a <br /> then it will start a new "row" for you to put more <span>'s in.
<div>
<span style="padding-right:2px;"
<span>column2</span><br />
<span style="padding-right:2px;"
<span>column4</span>
</div>
The spans will keep appending to the "row" that they are in. Once you insert a <br /> then it will start a new "row" for you to put more <span>'s in.
ASKER
But if I enhance the situation like:
In a div I have 4 spans, in which two spans should be aligned horizontally and two vertically, this fails like
<div>
<span style="padding-right:2px;"
<span>column2</span>
<span style="padding-right:2px;"
<span>column4</span>
</div>
Can it be possible to have column 3 display under coulmn 1 and coulmn 4 under coulmn 2.
Thanks and appreciated