Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 当表格高度为100%时,如何将表格行设置为特定值?_Html_Css_Html Table_Css Tables - Fatal编程技术网

Html 当表格高度为100%时,如何将表格行设置为特定值?

Html 当表格高度为100%时,如何将表格行设置为特定值?,html,css,html-table,css-tables,Html,Css,Html Table,Css Tables,我想在一个高度为100%的表格中列出文件:) 这是我的HTML(它是jade(pug),因为我使用NodeJS): 这也是我的CSS: table { color: black; border: 1px solid black; background: whitesmoke; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; height: 90

我想在一个高度为100%的表格中列出文件:)

这是我的HTML(它是jade(pug),因为我使用NodeJS):

这也是我的CSS:

table {
    color: black;
    border: 1px solid black;
    background: whitesmoke;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    height: 90vh;
    width: 100%;
    padding: 3%;
    table-layout: fixed;
}

tr {
    border-bottom: 1px solid black;
}

.table-responsive {
    overflow-x: auto;
    margin: 4%;
}
下面是渲染:

所以,我如何将所有行置于2vh高度(例如),并在没有行时在表中留空


谢谢

我最终通过使用响应类作为背景找到了解决方案

table {
    color: black;
    height: auto;
    width: 100%;
}

tr {
    border-bottom: 1px solid black;
}

td, th {
    padding: 1%;
}

.table-responsive {
    overflow-x: auto;
    margin: 4%;
    background: whitesmoke;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    height: 90vh;
}
并删除此项:
(style='line-height:2vh;height:2vh;')

现在,结果如下所示:

(我无法发布内联图像) 谢谢

table {
    color: black;
    height: auto;
    width: 100%;
}

tr {
    border-bottom: 1px solid black;
}

td, th {
    padding: 1%;
}

.table-responsive {
    overflow-x: auto;
    margin: 4%;
    background: whitesmoke;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    height: 90vh;
}