我有一个宽桌 - 如此宽,它不适合在屏幕宽度;所以浏览器必须显示滚动条。我希望这张表的左右两边有20px的空间;所以我试图用样式它(以下全码):在非常宽的HTML表格上获取正确的边距?
table {
margin-left: 20px;
margin-right: 20px;
text-align: left;
border-collapse: collapse;
background-color: #e0e4f5;
}
左缘显示预期:
但右边距不(位很难看 - 但注意
:与表的右边缘)水平滚动条的右边缘的对准
是否有可能获得某种右边界显示?
这里是我完整的测试代码:
表{ 保证金左:20像素; margin-right:20px; text-align:left; border-collapse:collapse; background-color:#e0e4f5; }
head 1head 2head 3head 4head 5head 6head 7head 8head 9head 10head 11head 12head 13head 14head 15head 16head 17head 18head 19head 20head 21head 22head 23head 24head 25head 26head 27head 28head 29head 30head 31head 32head 33head 34head 35head 36head 37head 38head 39head 40
Table footertest 1test 2test 3test 4test 5test 6test 7test 8test 9test 10test 11test 12test 13test 14test 15test 16test 17test 18test 19test 20test 21test 22test 23test 24test 25test 26test 27test 28test 29test 30test 31test 32test 33test 34test 35test 36test 37test 38test 39test 40test 1test 2test 3test 4test 5test 6test 7test 8test 9test 10test 11test 12test 13test 14test 15test 16test 17test 18test 19test 20test 21test 22test 23test 24test 25test 26test 27test 28test 29test 30test 31test 32test 33test 34test 35test 36test 37test 38test 39test 40test 1test 2test 3test 4test 5test 6test 7test 8test 9test 10test 11test 12test 13test 14test 15test 16test 17test 18test 19test 20test 21test 22test 23test 24test 25test 26test 27test 28test 29test 30test 31test 32test 33test 34test 35test 36test 37test 38test 39test 40test 1test 2test 3test 4test 5test 6test 7test 8test 9test 10test 11test 12test 13test 14test 15test 16test 17test 18test 19test 20test 21test 22test 23test 24test 25test 26test 27test 28test 29test 30test 31test 32test 33test 34test 35test 36test 37test 38test 39test 40