CSS table td width - fixed, not flexible

后端 未结 8 1705
温柔的废话
温柔的废话 2020-12-12 19:55

I have a table and I want to set a fixed width of 30px on the td\'s. the problem is that when the text in the td is too long, the td is stretched out wider than 30px.

8条回答
  •  不思量自难忘°
    2020-12-12 20:16

    Chrome 37. for non fixed table:

    td {
        width: 30px;
        max-width: 30px;
        overflow: hidden;
    }
    

    first two important! else - its flow away!

提交回复
热议问题