Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

In HTML, how can I use tables to structure forms?

user-image
Question added by Yasmeen Husam , Web Developer , Al Fahid Systems
Date Posted: 2019/01/31
Durgesh Pathak
by Durgesh Pathak , Software developer , Xcelserv solution pvt ltd

within form tag we define table tag to structure the form

siddharth rai
by siddharth rai , System Analyst , DXC.technology - India

To position form-related elements relative to each other, the entire table must be within the form. You cannot start a form in one TH or TD element and end in another. You cannot place the form within the table without placing it inside a TH or TD element.

 

try this

Small forms are sometimes placed within a TD element within a table. This can be a useful for positioning a form relative to other content, but it doesn't help position the form-related elements relative to each other.  To position form-related elements relative to each other, the entire table must be within the form. You cannot start a form in one TH or TD element and end in another. You cannot place the form within the table without placing it inside a TH or TD element. You can put the table inside the form, and then use the table to position the INPUT, TEXTAREA, SELECT, and other form-related elements, as shown in the following example.    <FORM ACTION="[URL]"> <TABLE BORDER="0"> <TR> <TH>Account:</TH> <TD><INPUT TYPE="text" NAME="account"></TD> </TR> <TR> <TH>Password:</TH> <TD><INPUT TYPE="password" NAME="password"></TD> </TR> <TR> <TD> </TD> <TD><INPUT TYPE="submit" NAME="Log On"></TD> </TR> </TABLE>

 

</FORM>

Midhun kp
by Midhun kp , Intern , Keltron Knowledge Centre

Small forms are sometimes placed within a TD element within a table. This can be a useful for positioning a form relative to other content, but it doesn't help position the form-related elements relative to each other.  To position form-related elements relative to each other, the entire table must be within the form. You cannot start a form in one TH or TD element and end in another. You cannot place the form within the table without placing it inside a TH or TD element

WITH IN FORM TAG WE DEFINE TABLE TAG TO STRUCTURE THE FORM

Creating an HTML form is an important aspect when creating a website. Forms are a method of interacting with the users of the website. Thus it becomes necessary that the forms must be properly aligned and attractive when implemented on a website. The process of simply adding an HTML form to a webpage is as follows.

 

Example:

HTML <!DOCTYPE html> <html>    <body>     <h2>Welcome To GFG</h2>     <p>Default code has been loaded into the Editor.</p>        <form>         <label for="name">Name</label>         <input type="text" id="name" />         <label for="email">Email</label>         <input type="email" id="email" />         <label for="telnum">Tel No.</label>         <input type="telnum" id="telnum" />         <label for="Roll No.">Roll No.</label>         <input type="number" id="rollno" />     </form> </body>    </html>

Adam Ahmed
by Adam Ahmed , IT & Web Developer , Freelance

Basm allah alrahman alrahim

 

here is an answer to your question link

 

 

Osama Danish
by Osama Danish , Csr , MARS BPO'S

Tables can be used to structure forms. First you have to start and close form tag " <form></form>" then write the name of the field you want to have in form page like Name, Age etc. This will be written within label tag <label for="name">Name</label>. Then the writing space can be created using input tag. It is a single tag.<input type="text" id="name" />

Mohammed Ibrahim
by Mohammed Ibrahim , Senior Software Developer , SAPIENS

1.Create an HTML table using the <table> element.

2.Now add the <form> element within this table.

3.Next, we will create form fields.

4.We add the required form fields to the form using the <tr> element that is used to add rows to a table.

5.We use the <td> element to add labels and fields for separate columns.

6.We can add as many fields as required to our form.

More Questions Like This