Search code examples
htmlformatwhitespace

Want to use multiple   in html?


I have a situation where I want to space out the elements in html using more than one space. Is there any way other than using multiple   ?

HTML:

<td width="10%">
    <a href=""><i class="glyphicon glyphicon-envelope"></i></a>View&nbsp;&nbsp;&nbsp;
    <a href=""><i class="glyphicon glyphicon-link"></i></a>Append&nbsp;&nbsp;&nbsp;
    <a href=""><i class="glyphicon glyphicon-trash"></i></a>Delete
</td>

Solution

  • I figured it out myself: This can be achieved by the following depending on how much space you want:

    &nbsp;    - single space
    &thinsp;  - thin space
    &ensp;    - en space(half the point size of the font)
    &emsp;    - em space(point size of the font)
    

    Reference: http://www.w3.org/MarkUp/html3/specialchars.html

    This is what I have done:

    <td width="10%">
        <a href=""><i class="glyphicon glyphicon-envelope"></i></a>View&thinsp;
        <a href=""><i class="glyphicon glyphicon-link"></i></a>Append&thinsp;
        <a href=""><i class="glyphicon glyphicon-trash"></i></a>Delete
    </td>
    

    Hope this helps out.