HTML:td布局问题

时间:2015-11-12 01:54:06

标签: html

真的无法在这里画出好东西,所以把它画在Excel中。

enter image description here

这是我尝试用HTML呈现一些代码:

<table>
    <thead>
        <th>
        <th>
        <th>
    </thead>
    <tbody>
        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>

        <p></p>

        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </tbody>
<table>

3 个答案:

答案 0 :(得分:5)

使用colspan合并列,如下所示:

<tr>
  <td colspan="3">This is how I want it to look</td>
</tr>

Demo

答案 1 :(得分:3)

<table border=1>
    <tr>
        <th>1</th>
        <th>2</th>
        <th>3</th>
    </tr>
    <tr>
        <td>4</td>
        <td>5</td>
        <td>6</td>
    </tr>
    <tr>
        <td colspan="3">7</td>

    </tr>

    <tr>
        <td>8</td>
        <td>9</td>
        <td>10</td>
    </tr>
</table>

答案 2 :(得分:1)

th,
td {
  border: 1px solid #cfcfcf;
  padding: 10px;
}
<table>
  <tr>
    <th>TH</th>
    <th>TH</th>
    <th>TH</th>
  </tr>
  <tr>
    <td>TD</td>
    <td>TD</td>
    <td>TD</td>
  </tr>
  <tr>
    <td colspan=3>TD</td>

  </tr>
  <tr>
    <td>TD</td>
    <td>TD</td>
    <td>TD</td>
  </tr>
</table>