1. 程式人生 > >兩個table表格在DIV內居中,並且不換行

兩個table表格在DIV內居中,並且不換行

<div style="width:940px;margin-left:auto; margin-right:auto;">
        <div style="background:red;width:120px;height:194px;display:inline;">
            <table border="1" style="display:inline;">
             <tr>
                 <th>fdfdfa</th>
                 <th>adadf</th>
             </tr>
             <tr>
                 <td>2324</td>
                 <td>4343</td>
             </tr>
             
         </table>
        </div>
        <div style="background:blue;width:120px;height:194px;display:inline;">
            <table border="1" style="display:inline;">
             <tr>
                 <th>fdfdfa</th>
                 <th>adadf</th>
             </tr>
             <tr>
                 <td>2324</td>
                 <td>4343</td>
             </tr>
             
         </table>
        </div>
    </div>