CSS text-overflow in a table cell?

后端 未结 12 1079
情话喂你
情话喂你 2020-11-22 04:38

I want to use CSS text-overflow in a table cell, such that if the text is too long to fit on one line, it will clip with an ellipsis instead of wrapping to mult

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 05:21

    This worked in my case, in both Firefox and Chrome:

    td {
      max-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      width: 100%;
    }
    

提交回复
热议问题