How to get the in HTML tables to fit content, and let a specific fill in the rest

后端 未结 4 1170
一向
一向 2020-12-23 13:23

This is a hypothetical example:

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 13:56

    demo - http://jsfiddle.net/victor_007/ywevz8ra/

    added border for better view (testing)

    more info about white-space

    table{
        width:100%;
    }
    table td{
        white-space: nowrap;  /** added **/
    }
    table td:last-child{
        width:100%;
    }
    

        table {
          width: 100%;
        }
        table td {
          white-space: nowrap;
        }
        table td:last-child {
          width: 100%;
        }
    Column A Column B Column C Column D
    Data A.1 lorem Data B.1 ip Data C.1 sum l Data D.1
    Data A.2 ipsum Data B.2 lorem Data C.2 some data Data D.2 a long line of text that is long
    Data A.3 Data B.3 Data C.3 Data D.3

提交回复
热议问题