Bootstrap tables overflowing with long unspaced text

前端 未结 5 1235
谎友^
谎友^ 2020-12-23 12:56

I\'m using Bootstrap and I have a table with a few columns, the last of which sometimes has a long piece of text without spaces. I noticed that under certain screen sizes, t

5条回答
  •  悲&欢浪女
    2020-12-23 13:42

    You can use below css. This will wrap the text and apply ... in the end of the text.

    e.g. This_is_a_large_text will be changed to This_is_a_lar...

    td {
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    

    You can also add tool tip to show the complete text value.

    ${text}
    

提交回复
热议问题