If the word is too long then the word is out of column borders. How to avoid it?

If the word is too long then the word is out of column borders. How to avoid it?

minsksterminskster Posts: 4Questions: 1Answers: 0

Could you look at example? http://codepen.io/anon/pen/yypaav
The long word is going to next column. Is it possible to hide the part of the word and show "..." at the end if the word is too long?
Could you recommend another solution?

This question has an accepted answers - jump to answer

Answers

  • minsksterminskster Posts: 4Questions: 1Answers: 0

    I have tried to apply workaround
    <td style="max-width: 100px">
    <span style=" text-overflow: ellipsis; break-word: break-word ; display: block; overflow: hidden">
    but if the you set the very small screen the expanded table out of panel: http://codepen.io/anon/pen/VYyrwX

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    edited February 2015

    Hi,

    $('#example').addClass('no-wrap');

    Should be:

     $('#example').addClass('nowrap');
    

    http://codepen.io/anon/pen/ogppeK

    Allan

  • minsksterminskster Posts: 4Questions: 1Answers: 0

    Thanks Allan,

    getting better but
    1) if the screen size small then table out of border because the "Position" column has fixed size
    2) if remove the <td style=... and click on + to expand the row then table out of border because the "Position" string is shown in one line fully.

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Answer ✓

    I've just updated the pen to use the latest versions of Bootstrap, DataTables, Responsive and the DataTables / Bootstrap integration.

    With them it appears to work okay: http://codepen.io/anon/pen/LEewdK .

    Note that I had to had nowrap CSS for the table as that isn't provided in Bootstrap.

    Allan

  • minsksterminskster Posts: 4Questions: 1Answers: 0

    Thanks Allan for this solution that helped me release in time! Write me if you need some help from me.

This discussion has been closed.