-1
在主页上工作我遇到以下问题: 我想显示一个表格 - 可以使用复选框选择表格列的数量。另外,我的网站应该在手机上工作,所以我放入了相应的元线。在CSS中使用水平滚动条的动态表格
不幸的是,我的网站不正确的,因为它不显示我的水平滚动条..
PHP代码工作:
echo '<table id="dynamictable">';
echo '<tr>';
foreach($res_category_arr as $columnname)
{
echo '<th>' . $columnname. '</th>';
}
echo '</tr>';
if (mysqli_num_rows($result) > 0)
{
while($data_current_row=mysqli_fetch_assoc($result))
{
echo '<tr>';
foreach($res_category_arr as $tabledata)
{
echo '<td>' . $data_current_row[$tabledata] . '</td>';
}
echo '</tr>';
}
}
echo '</table>';
res_category_arr表示一个数组,其中包含了想要的列名。 CSS代码:
#dynamictable{
width: 100%;
overflow-y: auto;
margin: 0 0 1em;
text-align: center;
}
#dynamictable::-webkit-scrollbar {
-webkit-appearance: none;
width: 14px;
height: 14px;
}
#dynamictable::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 3px solid #fff;
background-color: rgba(0, 0, 0, .3);
}