Word-wrap in an HTML table

后端 未结 25 3018
温柔的废话
温柔的废话 2020-11-22 02:45

I\'ve been using word-wrap: break-word to wrap text in divs and spans. However, it doesn\'t seem to work in table cells. I have a tabl

25条回答
  •  悲&欢浪女
    2020-11-22 03:46

    The answer that won the bounty is correct, but it doesn't work if the first row of the table has a merged/joined cell (all the cells get equal width).

    In this case you should use the colgroup and col tags to display it properly:

    Merged cell
    VeryLongWordInThisCell Cell 2

提交回复
热议问题