簡體   English   中英

如何在同一行上對齊HTML表和描述文本

[英]How to align a HTML table and description text on the same line

我使用html編寫此表格,並且希望使用這種格式,其中“ C2B Payments”的描述與圖片所示表格位於同一行,位於同一行的左側,而不是表格的頂部。 但是我不知道要怎么做。
任何人都可以帶領我。 謝謝

<p class="align left"> C2B Payments</p>
<table border="0" align="center"; margin: 0 auto;">
  <thead>
    <tr>       
      <th>Date</th>
      <th>Total Received</th>
      <td>Failed</td>
    </tr>
  </thead>
  <tbody>

的CSS

  .alignleft {
      float: left;
       }

這是?: https : //jsfiddle.net/d8bpy3gk/

    <p style="float:left; width:20%"> C2B Payments</p>
<table style="border:0; align:center; margin: 0 auto;float:left; width:80%">
  <thead>
    <tr>       
      <th>Date</th>
      <th>Total Received</th>
      <th>Failed</th>
    </tr>
  </thead>
  <tbody>
     <tr>       
      <th>10/10/10</th>
      <th>$ 200,00</th>
      <th>Failed</th>
    </tr>
  </tbody>

  </table>

加二師

  • 帶浮點數:左;

  • 帶顯示:內聯塊; 垂直對齊:頂部;

並將段落放在左邊,表格放在右邊

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM