Setting table row height

前端 未结 8 2074
旧时难觅i
旧时难觅i 2020-12-25 09:07

I have this code:

8条回答
  •  梦毁少年i
    2020-12-25 09:49

    I found the best answer for my purposes was to use:

    .topics tr { 
        overflow: hidden;
        height: 14px;
        white-space: nowrap;
    }
    

    The white-space: nowrap is important as it prevents your row's cells from breaking across multiple lines.

    I personnally like to add text-overflow: ellipsis to my th and td elements to make the overflowing text look nicer by adding the trailing fullstops, for example Too long gets dots...

提交回复
热议问题