我正在尝试使表格与页面正确对齐,但它位于页面左侧并正确显示内容部分。以下是链接:this。
我会发布CSS代码,但这个帖子太长了,我完全不知道问题的原因。有可能请看一下链接上的来源吗?
但是,这是文件的PHP代码:
<?php require "/customers/2/f/3/nta-aberdeen.org.uk//httpd.www//V2/require/header.php";?>
<section>
<div id="container">
<div id="leftcol">
</div><!-- end left column-->
<div id="content">
<?php include $version."ntc_center.".$filelang.".inc.php"; ?>
</div>
<div id="rightcol">
</div> <!-- end right column -->
</div> <!-- end content -->
</section>
<div class="push"></div>
</div> <!-- end container -->
<footer>
<div><p>Designed and maintained by <a href="mailto:laurens14@example.com">Laurens van Oorschot</a></p></div>
</footer>
</body>
</html>
这是包含中心部分所需的表文件的文件:
<b>Vergelijkings tabel:</b>
<table class="table" border=1>
<tbody>
<tr>
<th>LEEFTIJD</th>
<th>BO</th>
<th>Schotland</th>
</tr>
<tr>
<td>6 - 7 </td>
<td>groep 3 </td>
<td>Primary 2</td>
</tr>
<tr>
<td>7 - 8 </td>
<td>groep 4</td>
<td>Primary 3</td>
</tr>
<tr>
<td>8 - 9 </td>
<td>groep 5 </td>
<td>Primary 4</td>
</tr>
<tr>
<td>9 - 10 </td>
<td>groep 6</td>
<td>Primary 5</td>
</tr>
<tr>
<td>10 - 11 </td>
<td>groep 7</td>
<td>Primary 6</td>
</tr>
<tr>
<td>11 - 12 </td>
<td>groep 8 </td>
<td>Primary 7</td>
</tr>
</tbody>
</table>
<p>In Nederland loopt de schoolleeftijd van 1 oktober tot 1 oktober. In Schotland is dit van 1 maart tot 1 maart.</p>
有什么建议吗?
答案 0 :(得分:0)
如果您检查HTMl,您将看到该表不在内容div中。如果您将要在<div id="content">
div中对齐的所有内容放在一起,您将看到预期的结果。