我正在使用 materiailze CSS 和单元格中的表单元素对时间表进行编码。我不喜欢表格行的高度。有什么办法可以使表格更紧凑吗? 如果这是物化的限制,什么是更好的 CSS 框架选项?
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</head>
<body>
<form>
<table>
<col width=100>
<col width=100>
<col width=100>
<col width=100>
<col width=200>
<thead>
<tr>
<th>Date</th>
<th>Time</th>
<th>Date</th>
<th>Time</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="date" name="day" value="2019-01-01"></td>
<td><input type="time" name="day" value="10:00"></td>
<td><input type="date" name="day" value="2019-01-01"></td>
<td><input type="time" name="day" value="18:30"></td>
<td>
<select>
<option value=1>Regular shift</option>
<option value=2>Vacation</option>
</select>
</td>
<td><input name="day"></td>
</tr>
</tbody>
</table>
</form>
<script type="text/javascript" src="js/materialize.min.js"></script>
</body>
最佳答案
这只是一个小的 css 修复...
例如,您可以添加这一小段代码:
<style>
td {padding: 2px 5px;}
td input{margin:0 !important;height:2em !important;}
td .select-wrapper input.select-dropdown{height:2em;line-height:2em;}
</style>
关于html - 如何使具有表单元素的物化表更紧凑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58796064/