我正在試着製作一個表格,它從數據庫中調用一個值。問題是數據被水平壓縮。我想添加一個水平滾動條,以便輸出不會在另一個上方垂直地佔據一個字。用於PHP的水平滾動表
這裏是我的代碼
echo('<table border="1">');
echo "<tr>
<td5Folder</td>
<td>MDU</td>
<td>Contractor</td>
<td>Team</td>
<td>RDate</td>
<td>SIDate</td>
<td>ICDate</td>
<td>Status</td>
<td>Remarks1</td>
<td>Remarks2</td>
<td>Remarks3</td>
<td>Bill50</td>
<td>Bill30</td>
<td>Bill20</td>
<td>BillRemark</td>
</tr>";
while($row = mysql_fetch_array($rs)) {
$folderx = $row['FolderNo'];
$mdux = $row['MDU'];
$contractorx = $row['Contractor'];
$teamx = $row['Team'];
$rdatex = $row['RDate'];
$sidatex = $row['SIDate'];
$icdatex = $row['ICDate'];
$statusx = $row['Status'];
$remarks1x = $row['Remarks1'];
$remarks2x = $row['Remarks2'];
$remarks3x = $row['Remarks3'];
$bill50x = $row['Bill50'];
$bill30x = $row['Bill30'];
$bill20x = $row['Bill20'];
$billRemarkx = $row['BillRemark'];
echo "<tr>
<td>$folderx</td>
<td>$mdux</td>
<td>$contractorx</td>
<td>$teamx</td>
<td>$rdatex</td>
<td>$sidatex</td>
<td>$icdatex</td>
<td>$statusx</td>
<td>$remarks1x</td>
<td>$remarks2x</td>
<td>$remarks3x</td>
<td>$bill50x</td>
<td>$bill30x</td>
<td>$bill20x</td>
<td>$billRemarkx</td>
</tr>";
}
echo('</table>');
這是一個CSS問題,在的jsfiddle提供一些示例代碼與 – Imperative 2013-05-07 06:55:02
合作嘗試添加'溢出-y:auto;'在你的table/table的div樣式表上? – unkn0wn 2013-05-07 06:55:46
難道你不是指overflow-x:auto? – 2013-05-07 07:07:10