【问题标题】:Having problems with the form inside the table in HTML [duplicate]HTML表格内的表单存在问题[重复]
【发布时间】:2020-09-06 06:25:28
【问题描述】:

表格说明:

  1. 表格由四列六行组成。
  2. 表格嵌入表格中
  3. 表格由两列六行组成

    • 第 2 列第 2 行中的文本和文本框跨四行
    • 有两个
      标签用来分隔文本和文本框

      <table>
          <form name="application" method="post" action="">
          <tr>
              <th>Application Form</th>
          </tr>
          <tr>
              <td>First Name<input name="firstname" type="textbox" size="20"</td><br>
              <td rowspan="4">Countries and places you wish to visit:<br><br>
              <textarea></textarea></td></td>
          </tr>
          <tr>
              <td>Last Name:<input type="textbox" size="20"></td>
          </tr>
          <tr>
              <td>Phone number:<input type="textbox" size="20"></td>
          </tr>
          <tr>
              <td>Email:<input type="textbox" size="20"></td>
          </tr>
          <tr>
               <th colspan="4"><input type="submit" name="submit" id="submit" value="Submit">
              <input type="reset" name="reset" id="reset" value="Reset"></th>
          </tr>
          </form>
      

      我需要做这张桌子enter image description here

【问题讨论】:

  • 嗨,@Marland,欢迎来到 SO。您对上述代码遇到了什么问题?根据代码,您应该将&lt;form&gt;&lt;/form&gt; 移出&lt;table&gt;。而且你还需要添加一个闭包标签&lt;/table&gt;

标签: html html-table


【解决方案1】:

我已修改您的代码,请检查以下内容:

  1. formtable移出;

  2. 添加&lt;/table&gt;

  3. 调整textarea;

<form name="application" method="post" action="">
  <table cellpadding="10px">
    <tr>
        <th>Application Form</th>
    </tr>
    <tr>
        <td>First Name:<input name="firstname" type="textbox" size="20"</td>
        <td>Countries and places you wish to visit:</td>
    </tr>
    <tr>
        <td>Last Name:<input type="textbox" size="20"></td>
        <td rowspan="3" valign="top">
          <textarea></textarea>
        </td>
    </tr>
    <tr>
        <td>Phone number:<input type="textbox" size="20"></td>
    </tr>
    <tr>
        <td>Email:<input type="textbox" size="20"></td>
    </tr>
    <tr>
       <th colspan="4">
         <input type="submit" name="submit" id="submit" value="Submit">
         <input type="reset" name="reset" id="reset" value="Reset">
       </th>
    </tr>
  </table>
</form>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-15
    • 2013-03-20
    • 2012-09-19
    • 2019-01-04
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多