动态表大小html [英] Dynamic table size html
问题描述
我正在制作一个网站,无论屏幕尺寸如何,都必须适应整个屏幕。我正在使用表格来使用这个,但是我遇到了一个问题。
I'm making a website that has to fit in the entire screen regardless of screen-size. I'm using a table to use this at the moment but I ran into a problem.
网页分为3列:
左栏停留在屏幕的左侧,具有固定大小的背景。
右列保留在屏幕右侧,具有固定大小的背景。
中间的列应该在相邻的单元格之间拉伸,并且应该有一个可以延伸的背景(仅在水平方向)
The web page is divided into 3 columns: the left column stays at the left of the screen and has a fixed size with a background. the right column stays at the right of the screen and has a fixed size with a background. the middle column should be stretched between his neighbouring cells and should have a background that stretches with it (only horizontally)
这样一来,网页应该总是看起来因为它是为您用于查看该网站的屏幕。
This way the web page should always look as it was made for the screen you're using to view the site.
但是我的问题是中间单元格,图像不重复,不知何故css代码: background-repeat:x-repeat;
不会使图像延伸,当我将单元格宽度设置为100%时,会干扰其相邻的单元格,使其看起来像一个混乱。
However my problem is the middle cell, the image doesn't repeat, somehow the css code: background-repeat:x-repeat;
doesn't make the image stretch, also when I put the cell width on 100% it interferes with his neighbouring cells making it look like a mess.
如何实现?
编辑
这是我使用的标记:
CSS:
#topleftcell
{
background-image:url(../images/Logo.png);
background-repeat:no-repeat;
width:300px;
}
#topmiddlecell
{
background-image:url(../images/header_fill.png);
background-repeat:repeat-x;
width:auto;
}
#toprightcell
{
background-image:url(../images/header_right.gif);
background-repeat:no-repeat;
width:16px;
}
HTML:
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr style=" width:100%;">
<td id="topleftcell"></td>
<td id="topmiddlecell"></td>
<td id="toprightcell"></td>
</tr>
</table>
</body>
推荐答案
左右单元格固定宽度。
中央单元格中的自动宽度。您可能需要在中央单元格中填充填充图像。
fixed width on left and right cell. auto width in center cell. you probably need a filler image in the center cell.
这篇关于动态表大小html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!