html - 如何制作不同尺寸的 table

标签 html css twitter-bootstrap

我试图在 css 中制作下表,但没有白费。

下面是我的代码:

<table  cellspacing="0">
  <tr style="background: #70ad47; color:white;" >
    <th  width = "50" height = "60" >Compulsory Third party* (thisis the minimum insurance cover required in Kenya)</th>
    <th width="50%">Third party with fire and Theft</th>
    <th width="50%">Comprehensive Motor Insurance</th>
    <td></td>
  </tr>
  <tr>
    <tbody>
      <tr style="background: #70ad47; color:white;" >
        <td class = "first">3rdpartyproperty damage due to your motor vehicle’s involvement</td>
        <td width="50%">Includes all Compulsory Third party cover plus:</td>
        <td width="50%">Includes all Compulsory; Fire and Theft plus:-</td>
      </tr>
      <tr class = "second" >
        <td  width="50%" height = "98" >3rdParty personal injuries</td>
        <td  width="50%" height = "98" >Theft</td>
        <td  width="50%" height = "98" >Malicious Damage</td>
      </tr>
      <tr style="background: #70ad47; color:white;" >
        <td  width="50%" height = "98" ></td>
        <td  width="50%" height = "98" >Damage due to Fire</td>
        <td  width="50%" height = "98" >Accidental Damage to your Vehicle</td>
      </tr>
    </tbody>
</table>

我要制作的表格:

enter image description here

最佳答案

试试这个

table tr th{ border:1px solid #fff; border-bottom:5px solid #fff; padding:8px;}
table tr td{border:1px solid #fff; padding:8px;}
table{background: #70ad47; color:white;}
.list{display:list-item; list-style-position: inside;}
<table  cellspacing="0">
          <tr>
            <th>Compulsory Third party* (thisis the minimum insurance cover required in Kenya)</th>
            <th>Third party with fire and Theft</th>
            <th>Comprehensive Motor Insurance</th>
          </tr>
          <tr>
            <tbody>
              <tr >
                <td>3rdpartyproperty damage due to your motor vehicle’s involvement</td>
                <td>Includes all Compulsory Third party cover plus:</td>
                <td>Includes all Compulsory; Fire and Theft plus:-</td>
              </tr>
              <tr style="background: #70ad47; color:white;" >
                <td>3rdParty personal injuries</td>
                <td><div class="list">Theft</div></td>
                <td><div class="list">Malicious Damage</div></td>
              </tr>
              <tr >
                <td></td>
                <td><div class="list">Damage due to Fire</div></td>
                <td><div class="list">Accidental Damage to your Vehicle</div></td>
              </tr>
            </tbody>
          </table>

关于html - 如何制作不同尺寸的 table ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35194563/

相关文章:

html - Logo 未出现在导航栏/Bootstrap 中

css - 在 Angular 4 元素中安装了 ng-bootstrap CSS,但它似乎不起作用

javascript - 图像的尺寸,然后检查标准

jquery - 将类随机添加到两个 div 之一

css - 移除 Safari/Chrome textinput/textarea glow

javascript - 粘性导航在第一次滚动时进行奇怪的跳跃(固定位置)

html - CSS 未加载

css - 如何将 glyphicon 添加到 bootstrap 下拉菜单

javascript - 如何在 HTML 中获取元素的形状/多边形/边界路径/框架?

javascript - 动态显示 Accordion ,单击时第一个 Accordion 打开和关闭前一个 Accordion