How to hide Table Row Overflow?

前端 未结 7 891
故里飘歌
故里飘歌 2020-11-28 09:16

I have some html tables where the textual data is too large to fit. So, it expands the cell vertically to accommodate for this. So now rows that have the overflow are twic

7条回答
  •  死守一世寂寞
    2020-11-28 09:35

    In general, if you are using white-space: nowrap; it is probably because you know which columns are going to contain content which wraps (or stretches the cell). For those columns, I generally wrap the cell's contents in a span with a specific class attribute and apply a specific width.

    Example:

    HTML:

    My really long description
    

    CSS:

    span.description {
        display: inline-block;
        overflow: hidden;
        white-space: nowrap;
        width: 150px;
    }
    

提交回复
热议问题