【问题标题】:How to add multiple header HTML table?如何添加多个标题 HTML 表格?
【发布时间】:2017-10-09 09:59:17
【问题描述】:

我想设计一个有多个标题的表格。桌子设计在那里:

【问题讨论】:

标签: html database-design bootstrap-table


【解决方案1】:

看看这个fiddle

关于 colspan 和 rowspan

<table>
    <thead>
        <tr>
            <th rowspan="2" colspan="1" >
                Client Name
            </th>
            <th rowspan="2" colspan="1">
                Date
            </th>
            <th rowspan="1" colspan="5">
                All Appointments
            </th>
            <th rowspan="1" colspan="3" >
                Fulfilled Appointments
            </th>
        </tr>
        <tr>
            <th>Total number of individual appointments</th>
            <th >Hours Of Care Delivered</th>
            <th>Total Value</th>
            <th>Average Cost Per Hour</th>
            <th>Average Cost Per Hour Per Carer</th>
            <th>Total Number</th>
            <th>Hours Of Care Fulfilled</th>
            <th>Total Value</th>
        </tr>
    </thead>
    <tbody></tbody>
</table>

【讨论】:

    【解决方案2】:
    <html>
    <head>
    <title>Table</title>
    <style>
    table,th,td {
        border: 2px solid red;
        border-collapse: collapse;
    }
    
    .heightu{
        height: 212px;
    }
    
    div.First {
    border: 1px solid red;
    width: 49px;
    height:10px;
    left: 15px;
    }
    
    div.Second {
    border: 1px solid red;
    width: 49px;
    height:10px;
    left: 15px;
    
    }
    
    div.Third {
        border: 1px solid red;
    width: 39px;
    height:10px;
    left: 15px;
    }
    
    </style>
    
    
    
    </head>
    <body>
    <table>
        <tr>
            <th rowspan="2">Sl.No</th>
            <th rowspan="2">Name</th>
            <th  colspan="2">Date:15/05/2021</th>
            <th rowspan="2">Do &nbsp;&nbsp;&nbsp; </th>
           </th>
        </tr >
    
        <tr>
            <th rowspan=>Start Hour</th>
            <th rowspan=>End Hour</th>
        </tr>
    
        <tr>
            <td>1</td>
            <td>John Ddoe</td>
           <td ><div class="First"></div></td> 
            <td><div class="Second">&nbsp;</div></td>
            <td><div class="Third"></div></td>
        </tr>
    
        <tr class="heightu">
            <td></td>
            <td></td>
            </td>
            <td ></td>
            <td ></td>
            <td ></td>
        </tr>
         </table>
        </body>
        </html>
    

    【讨论】:

      猜你喜欢
      • 2017-04-16
      • 1970-01-01
      • 2016-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-23
      • 1970-01-01
      相关资源
      最近更新 更多