我有一個表格,住在一個div內。該表中有一個與窗口重疊的巨大內容,因此我需要向左滾動以查看其內容。問題在於表格右側沒有填充或邊距,使其更易於閱讀。設置填充/溢出表的餘量
如何向該表格添加填充或邊距?
下面是HTML的樣子(請注意,下面的CSS不工作):
<html>
<head></head>
<body>
<div id="table">
<table>
<thead>...</thead>
<tbody>...</tbody>
</table>
</div>
<style>
table td, table th, table td {border: 1px solid red}
table { padding-right: 100px; border: 1px solid blue}
table thead, table tbody {padding-right: 100px;}
</style>
</body>
</html>
將css放在head部分..或者在.css文件中並在head標籤中創建鏈接 –
當然,這僅僅是爲了演示目的 – petwho