Getting div to occupy full cell height

前端 未结 3 993
抹茶落季
抹茶落季 2020-12-20 23:24

How do I get divs within table cells to occupy the full height of the cell?

Setting div height=100% won\'t work unless the table cell has a fixed height on it, but

3条回答
  •  离开以前
    2020-12-21 00:06

    Try this:

    table { height: 100%; }
    
    td
    {
        padding:0px;
        vertical-align:top;
        height:100%;
    }
    
    .box
    {
        margin:0px;
        border:solid 2px red;
        height:100%;
    }
    

    Working Sample (tested on FF4)

提交回复
热议问题