Html 当表格高度为100%时,如何将表格行设置为特定值?
我想在一个高度为100%的表格中列出文件:) 这是我的HTML(它是jade(pug),因为我使用NodeJS): 这也是我的CSS: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
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;
}