HTML如何在一行中对齐两个表? [英] HTML how to align two tables in one row?

查看:419
本文介绍了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>

这篇关于HTML如何在一行中对齐两个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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