我正在尝试使用表格为输入创建表单

时间:2015-09-25 09:30:50

标签: javascript html

正如我所说,我正在使用表来创建表单。 input-small及其标签适合各种场合。我在一列中打开了三行来放置一个3行textarea。简单的我想,但是我得到一个搞砸的表在实时视图中看起来没问题,但有一半的输入小占位符丢失,在设计视图(Dreamweaver)中它充满了破碎的标签。 这是没有textarea和。的代码。

没有

    <table width="581" border="0" summary="Contact">
  <caption>
    Personal Details
  </caption>
  <tr>
    <td width="120">Full Name</td>
    <td width="226"><input class="input-small" type="text" placeholder=".input-small"></td>
    <td width="71">Phone</td>
    <td width="146"><input class="input-small" type="text" placeholder=".input-small"></td>
  </tr>
  <tr>
    <td>Postal Address</td>
    <td rowspan="4">&nbsp;</td>
    <td>Email</td>
    <td><input class="input-small" type="text" placeholder=".input-small"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td rowspan="2">Emergency Contact</td>
    <td rowspan="2"><input class="input-small" type="text" placeholder=".input-small"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Postcode</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

使用

    <table width="581" border="0" summary="Contact">
  <caption>
    Personal Details
  </caption>
  <tr>
    <td width="120">Full Name</td>
    <td width="226"><input class="input-small" type="text" placeholder=".input-small"></td>
    <td width="71">Phone</td>
    <td width="146"><input class="input-small" type="text" placeholder=".input-small"></td>
  </tr>
  <tr>
    <td>Postal Address</td>
    <td rowspan="4"><textarea rows="3" class="input-xxlarge" placeholder=".input-xxlarge"></td>
    <td>Email</td>
    <td><input class="input-small" type="text" placeholder=".input-small"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td rowspan="2">Emergency Contact</td>
    <td rowspan="2"><input class="input-small" type="text" placeholder=".input-small"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Postcode</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

干杯

2 个答案:

答案 0 :(得分:1)

你的问题是textarea没有关闭:

<td rowspan="4"><textarea rows="3" class="input-xxlarge" placeholder=".input-xxlarge"></textarea></td>

请参阅</textarea>。这是必要的。

答案 1 :(得分:1)

使用</textarea>关闭字段:

<textarea rows="3" class="input-xxlarge" placeholder=".input-xxlarge"></textarea>