HTML-表比指定内容更宽,内容包含在内

问题描述 投票:0回答:1

我将发布我的HTML,但我不确定第一个表(包含所有后续表)是否总是比其他内容宽2-3个像素。我花了最后2个小时来解决我认为应该是一个简单的修复...但我似乎无法找到可能导致问题的任何其他区域。如果解决方案很明显,我很抱歉,因为我在高中时没有设计过网站所以我的技能有点生锈/老化。

<html>
<head>
<title>Piedmont Wealth Solutions</title>

<style type="text/css"><!--
a:link {
color:000000; font-face:arial; font-size:10pt; text-decoration:none
}
a:visited {
color:000000; font-face:arial; font-size:10pt; text-decoration:none
}
a:active {
color:000000; font-face:arial; font-size:10pt; text-decoration:none
}
a:hover {
color:000000; font-face:arial; font-size:10pt; text-decoration:underline
}
body {
color:Body; font-size:10pt; font-family:Arial;
}
td {
color:Body; font-size:10pt; font-family:Arial
}
--></style>
</head>
<body bgcolor="e9e9e9" background="page_bg.gif" font face="arial" size="10" valign="top" topmargin="0" leftmargin="180">


<table width="537" cellspacing="0" cellpadding="0" valign="top" align="left" height="100%" border="0" bgcolor="265b78">

<tr width="537" valign="top" align="left">
<td valign="top" align="left" width="36" background="table_bg_left.gif">
</td>


<td width="501" valign="top" align="left">
<!------banner/nav----->

<table width="501" valign="top" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="c5c5c5">
<tr valign="top" align="left" border="0">



<img src="banner_nav.jpg" border="0" valign="top" align="left">
<img src="content_top_spacer.jpg" border="0" valign="top" align="left">

</td>
</tr>
</table>


<!------content------>
<table width="501" height="350" cellspacing="0" cellpadding="0" border="0" align="left">
<tr valign="top" align="left">
<td valign="top" align="left" width="356" bgcolor="f5F8Fa">

<img src="aboutus_header.jpg" border="0" valign="top"> 
<br>
<br>


Content
</td>


<td valign="top" width="144" bgcolor="f0f3f5">

<img src="news_header.jpg" border="0" align="left" valign="top"> <br><br>


google news feed
</td>
</tr>
</table>

<!------address/disclaimer------>

<table width="501" cellspacing="0" cellpadding="0"  height="45%" border="0" valign="top" align="left" bgcolor="265b78">
<tr valign="top" align="left">
<td valign="top" align="left" height="15" bgcolor="aac6d5">
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" height="15" bgcolor="7da6bc">
</td>
</tr>

<tr valign="top" align="left">
<td valign="top" align="left">

<img src="bottom_disclosure.jpg" align="left" valign="top" border="0">

</td>
</tr>
</table>


</td>
</tr>
</table>


</td>
</tr>
</table>



</body>
</html>
html html-table width
1个回答
0
投票

表格不应该用于布局目的,这就是CSS的用途。表格用于表格数据。使用CSS,您可以非常好地控制内容的位置和尺寸。

Here's a collection of reasons why you should opt for CSS.

This is (IMHO) the best book for a head start.

© www.soinside.com 2019 - 2024. All rights reserved.