I want to get a line break when it is necessary in my text, but ...">

Space in space

In this case:

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

I want to get a line break when it is necessary in my text, but I do not want my run to appear on a new line, I want it to always adhere to part of the text. How can i do this?

Thanks,

+9
source share
2 answers

How I solved my problem by putting one gap in another:

 <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 out the JSFiddle .

+14
source

Replace all spaces before the span one unallocated space (if you want some distance to appear between your text and any visualizer that you created in the span style, if no space is required, omit &nbsp; ).

 <td> Some Text&nbsp;<span class="Icon"></span> </td> 
+3
source

Source: https://habr.com/ru/post/1207198/


All Articles