背景颜色没有填充行的扩展表列

时间:2013-02-17 15:50:41

标签: html css background-color

我有一个扩展的表,但只有两行数据。我想将第一个的背景颜色一直涂到页面底部,但我不确定这样做,特别是因为没有行扩展表格。不确定是否有办法做到这一点,但会感谢任何帮助。

这是JS小提琴:jsfiddle.net/5E24f/ 我希望第1列的背景颜色延伸到页面的底部。

1 个答案:

答案 0 :(得分:1)

唯一可行的方法是,如果您确切知道第一列的宽度。

http://jsfiddle.net/5E24f/4/

table.patientinfo:after {
    content: " ";
    background: orange; /* replace with your bg color */
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 17px; /* matches the width of your first column */
    z-index: -1;
}