将3张桌子放在左上方,第2张放在它下面(左侧),第3张放在右上角

时间:2015-08-02 02:34:49

标签: html css vertical-alignment css-tables

如何将3个表L1,L2,R1放在下面指定的位置:

  1. 左上角的L1
  2. L2左下方的L2
  3. 右上角的R1
  4. table.one {
    float:left;
    width:45%;
    }
    
    table.two   {
    width:45%;
    float:right;
    }
    

    https://jsfiddle.net/Lvsu0vdz/

1 个答案:

答案 0 :(得分:1)

无需引导程序。你走了。

 .inlineTable {
   display: inline-block;
 }
 table.one {
   width: 45%;
   display: inline-block;
 }
 table.two {
   width: 45% float: left;
 }
<div class="inline table">
  <table class="one">
    <tr>
      <th>Month-1</th>
      <th>Savings-1</th>
    </tr>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
  </table>

  <table class="one">
    <tr>
      <th>Month-2</th>
      <th>Savings-2</th>
    </tr>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
  </table>
</div>

<table class="two">
  <tr>
    <th>Month-3</th>
    <th>Savings-3</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>