无论如何,HTML表格都不适合整个屏幕 [英] HTML table wont fit whole screen no matter what

查看:133
本文介绍了无论如何,HTML表格都不适合整个屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我在我的网站上有一张桌子,它不适合100%宽度的浏览器屏幕。即使当我将宽度更改为110%时,它只是重叠右侧,但在左侧(表格的外部空间)仍有空白区域。我希望桌子从左到右完全按压在浏览器屏幕上,根本没有空间或边框。我该怎么做呢?我已经尝试了一切,但它仍然不会工作。我甚至尝试过利润率和填充量。请帮助我失去理智。这里是我有的代码:

 < table bgcolor =#DBD9D9rules =noneborder =0 width =110%cellspacing =0cellpadding =0> 
< tr>
< td> TEXT HERE< / td>
< / tr>
< / table>

更新:我将css代码添加到colin建议的标题中,它仍然无效。 body {margin:10px;} table {margin:0-10px;}

解决方案

设置身体的边距和填充为0.(也许宽度为100%也有帮助。)


Basically, I have a table on my website that wont fit 100% width of the browser screen. Even when I change the width to 110% it simply overlaps the right side but still has a margin space on the left side( the outer space of table). I want the table to be completely pressed against the browser screen from left to right with no space or border at all. how do I do this? I have tried everything and it still wont work. I even tried negative margin and padding

please help I am losing my mind. here is the code I have:

<table bgcolor="#DBD9D9" rules="none" border="0" width="110%"cellspacing="0" cellpadding="0">
  <tr>
    <td>TEXT HERE</td>
  </tr>
</table>

UPDATE: I added the css code to the header like colin suggested and it still doesnt work. body {margin:10px;} table {margin:0 -10px;}

解决方案

I had this once too: the solution was to set the body's margin and padding to 0. (Perhaps width to 100% helps too.)

这篇关于无论如何,HTML表格都不适合整个屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆