HTML如何在一行中对齐两个表?
问题描述:
如何在页面中间将两张表对齐? 我想看的结果:
How to align two tables in one row, in the middle of the page? The results that I want to see:
11 12 11 12
21 22 21 22
我得到的结果:
11 12
21 22
11 12
21 22
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>11</td>
<td>12</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>11</td>
<td>12</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
</tr>
</table>
答
请使用它,根据要求调整宽度,如果要放置在文档的中心,请取div并将其对齐页面并将以下html放入其中.
Please use this, adjust the width as per the requirement and if you want to place at the center of the document the take a div and align it center of the page and place the following html in it.
<table border="0" cellpadding="0" cellspacing="0" style="width:50%;float:left">
<tbody>
<tr>
<td> 11</td>
<td> 12</td>
</tr>
<tr>
<td> 21</td>
<td> 22</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="width:50%;float:left">
<tbody>
<tr>
<td> 11</td>
<td> 12</td>
</tr>
<tr>
<td> 21</td>
<td> 22</td>
</tr>
</tbody>
</table>