html - HTML 表格内的表单出现问题

标签 html html-table

表格说明:

  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>
      

      我需要制作这张 table enter image description here

最佳答案

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

  1. 移出form来自table ;

  2. 添加</table>

  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>

关于html - HTML 表格内的表单出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61903749/

相关文章:

html - Golang 中的计数器 html 标签 map 无法正常工作

JavaScript 未捕获引用错误 : ListMgr is not defined

html - 如何使用 AEM 提供的搜索 api 获取自动建议/自动更正功能

html - 为什么我的 Chrome 表格单元格宽度错误?

html - 当内容超过最小高度时固定内容侧边栏的高度

iphone - iOs 5 Safari 新特性 "reader",开发者如何使用?

javascript - 如何在不创建数组的情况下使用 NgFor 来生成矩阵 UI 模式

html - 两张 table 并排

html - 无法使我的 <table> 属性的 CSS 正常工作

javascript - 抓取 HTML(或 JavaScript)表