Table cell widths - fixing width, wrapping/truncating long words

前端 未结 7 2218
清酒与你
清酒与你 2021-02-01 02:07

I have a table containing cells with text of various lengths. It is essential that all of the table cells are of the same width. If this means truncating long words or forcing a

7条回答
  •  不要未来只要你来
    2021-02-01 02:45

    I realize you needed a solution for IE6/7 but I'm just throwing this out for anyone else.

    If you can't use table-layout: fixed and you don't care about IE < 9 this works for all browsers.

    td {
        overflow-x: hidden;
        overflow-y: hidden;
        white-space: nowrap;
        max-width: 30px;
    }
    

提交回复
热议问题