Word-wrap in an HTML table

后端 未结 25 3013
温柔的废话
温柔的废话 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:26

    Tested in IE 8 and Chrome 13.

    longtexthere
    Foo

    This causes the table to fit the width of the page and each column to take up 50% of the width.

    If you prefer the first column to take up more of the page, add a width: 80% to the td as in the following example, replacing 80% with the percentage of your choice.

    longtexthere
    Foo

提交回复
热议问题