Having problems with the form inside the table in HTML

Viewed 85

form instructions:

  1. the table consist of four columns and six rows.
  2. the form is embedded inside a table
  3. the table consist of two columns and six rows

    • the text and text box in Column 2, Row2 span four rows
    • There are two
      tags used to separate the text and text box

      <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>
      

      I need to make this tableenter image description here

1 Answers

I have modified your codes, please check below:

  1. Move out the form from table;

  2. Add </table>

  3. Adjust the 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>

Related