CSS Table with one column taking remaining space

前端 未结 6 963
北荒
北荒 2020-12-16 13:04

I have tried now several things (and looked around here) and nothing worked so far. So I am going to ask.

What I want:

I have the following

6条回答
  •  猫巷女王i
    2020-12-16 13:23

    You can re-arrange the columns by moving the longest one at the end then use nested tables.

    CSS

    .extend
    {
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
        -o-text-overflow:ellipsis;
    }
    td
    {
        white-space:nowrap;
    }
    .box
    {
        width:1000px;
        border:blue solid thick;
        overflow:hidden;
    }
    

    HTML

    First column with text Small column
    This column should fill the remaining space but should be truncated if the text is too long. This column should fill the remaining space but should be truncated if the text is too long. This column should fill the remaining space but should be truncated if the text is too long. This column should fill the remaining space but should be truncated if the text is too long. This column should fill the remaining space but should be truncated if the text is too long.

    Except for the ellipsis it is working well. See result

提交回复
热议问题