whitespace nowrap on span

Mina picture Mina · Nov 19, 2014 · Viewed 42.2k times · Source

In this case:

<td>
       Some Text
       <span class="Icon"></span>
</td>

I want to get the line break when necessary on my Text but I don't want my span to get on a new line, I want it to always stick to part of the text. How can I do it?

Thanks,

Answer

Mina picture Mina · Nov 19, 2014

How I solved my problem by putting one span into the other:

<table style="width:100px">
<tr>
    <td>
        I am Showing you what <span style=" white-space: nowrap;">I meant
        <span> Blah Blah </span></span>
    </td>

</tr>

Check JSFiddle.