试图将表拆分为两列

时间:2015-05-07 00:45:16

标签: html html-table fieldset

我试图让一张桌子分成两半,一部分在左边,另一部分在右边,但桌子一直停留在一边。我希望输入字段排列内联列名称,这就是我试图将其放在表中的原因。

下面的屏幕截图显示了我想要完成的任务。

enter image description here



<fieldset class="Application">
  <Legend>
    <h2>Owners, Officers, Partners Information</h2>
  </legend>
  <table>

    <tr>
      <tr>
        <td>

          <tr>
            <td>Name:</td>
            <td>
              <input type="text" name="ownname" size="10" />
            </td>
          </tr>
          <tr>
            <td>Title:</td>
            <td>
              <input type="text" name="title" size="10" />
            </td>
          </tr>
          <tr>
            <td>Percentage Held:</td>
            <td>
              <input type="text" name="percent" size="10" />
            </td>
          </tr>
          <tr>
            <td>Street:</td>
            <td>
              <input type="text" name="ownstreet" size="10">
            </td>
          </tr>
          <tr>
            <td>City-State-Zip:</td>
            <td>
              <input type="text" name="owncity" size="10" />
            </td>
          </tr>
          <tr>
            <td>SSN:</td>
            <td>
              <input type="text" name="SSN" />
            </td>
          </tr>
        </td>
      </tr>
      <tr>
        <td>
          <tr>
            <td>Name:</td>
            <td>
              <input type="text" name="ownname" size="10" />
            </td>
          </tr>
          <tr>
            <td>Title:</td>
            <td>
              <input type="text" name="title" size="10" />
            </td>
          </tr>
          <tr>
            <td>Percentage Held:</td>
            <td>
              <input type="text" name="percent" size="10" />
            </td>
          </tr>
          <tr>
            <td>Street:</td>
            <td>
              <input type="text" name="ownstreet" size="10">
            </td>
          </tr>
          <tr>
            <td>City-State-Zip:</td>
            <td>
              <input type="text" name="owncity" size="10" />
            </td>
          </tr>
          <tr>
            <td>SSN:</td>
            <td>
              <input type="text" name="SSN" />
            </td>
          </tr>
        </td>
      </tr>
    </tr>

  </table>
</fieldset>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

这样的东西?

&#13;
&#13;
table {
  width: 100%
}
&#13;
<fieldset class="Application">
  <table>
    <legend>
      <h2>Owners, Officers, Partners Information</h2>
    </legend>
    <tr>
      <td>

        <tr>
          <td>Name:</td>
          <td>
            <input type="text" name="ownname" size="10" />
          </td>
          <td>Name:</td>
          <td>
            <input type="text" name="ownname" size="10" />
          </td>
        </tr>
        <tr>
          <td>Title:</td>
          <td>
            <input type="text" name="title" size="10" />
          </td>
          <td>Title:</td>
          <td>
            <input type="text" name="title" size="10" />
          </td>
        </tr>
        <tr>
          <td>Percentage Held:</td>
          <td>
            <input type="text" name="percent" size="10" />
          </td>
          <td>Percentage Held:</td>
          <td>
            <input type="text" name="percent" size="10" />
          </td>
        </tr>
        <tr>
          <td>Street:</td>
          <td>
            <input type="text" name="ownstreet" size="10">
          </td>
          <td>Street:</td>
          <td>
            <input type="text" name="ownstreet" size="10">
          </td>
        </tr>
        <tr>
          <td>City-State-Zip:</td>
          <td>
            <input type="text" name="owncity" size="10" />
          </td>
          <td>City-State-Zip:</td>
          <td>
            <input type="text" name="owncity" size="10" />
          </td>
        </tr>
        <tr>
          <td>SSN:</td>
          <td>
            <input type="text" name="SSN" />
          </td>
          <td>SSN:</td>
          <td>
            <input type="text" name="SSN" />
          </td>
        </tr>
      </td>
    </tr>
  </table>
</fieldset>
&#13;
&#13;
&#13;