在HTML中对齐表格

时间:2017-06-05 12:15:06

标签: html css html5 sharepoint alignment

我有一个HTML页面。这就是我希望它看起来像desired page layout,这是我到目前为止所得到的。 enter image description here

它在SharePoint中,我想使用内联CSS。 HTML下面,欢迎任何建议。

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-     style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg .tg-yw4l{vertical-align:top}
 </style>
<table class="tg" align="left" table border="1" style="padding-right:   10px;">

    

    <h1>Devices</h1>
    <div id="devices">
    </div>
</td>

  

<table class="tg">
<//table align="center">
  <tr>
<    td class="tg-yw4l">
        <h1>Device Details</h1>
    <div id="devicedetails">
    </div>
</td>
<td class="tg-yw4l">
<h1>Specfication </h1> 
    <div id="deviceoverview">
     <div id="devicekind">   
    </div>

  

</table>
<p>  </p>
<table class="tg">
  <tr>
    <td class="tg-yw4l">
        <h1>Known Issues</h1>
    <div id="knowntitle">
        <div id="knownsystemissues">

    </div>
</td> 
</tr>
</table>

<table class="tg" align="center">
  <tr>
   <td class="tg-yw4l" align="center">

      <h1>Accessories</h1>
    <div id="deviceacc">


</td>

    

<table class="tg" align="left" width="50%">
      <tr>
<td class="tg-yw4l">
    <h1>Typical Usage</h1>

    <div id="deviceuse">
    </div>
</td>
<//td class="tg-yw4l">

    <div id=" ">



    </div>

  

1 个答案:

答案 0 :(得分:0)

<style>
  td {
    padding: 2rem;
    border: 1px solid black;
  }
</style>
<table>
  <tr>
    <td rowspan="3">Devices</td>
    <td>Devise Details</td>
    <td>Specification</td>
  </tr>
  <tr>
    <td>Known Issues</td>
    <td>Accessories</td>
  </tr>
  <tr>
    <td colspan="2">Typical Usage</td>
  </tr>
</table>