This article mainly introduces the difference between the HTML form label and the table label, this article describes the form label and table label the differences between the form label and the table label the respective role of the difference, now let's start to read the article
Let's look at the three-point difference between the HTML form label and the table tag:
The form in 1.html represents a form, used to surround a series of controls, and then send the data to the target, such as the most common registration, you say the need to fill in the information, are encapsulated in the form, after completion, submit the contents of the form, if no longer within the form will not be submitted.
2.table is used for layout when you fill in the information when you have found the page provided by the text box, text, buttons and so on. They're all very neat. This is the function of table, a row of the form of a table to display content.
3.table is used only for layout purposes, and the form is used to encapsulate the data. The two are conceptually different and usually play a role in the form, but how do the random text boxes in the form look neat, so it's usually a form that is nested in a table.
See an example of the difference between a form and table:
<form action= ' 123.jsp ' ><table><tr><td> username: </td><td><input type= ' text '/ ></td><tr></table></form>
Effect everyone should be able to think of it:
What is really going to be presented to the server is the form element contained in the form, and table simply places the elements neatly on the page.
Next, look at the difference between the form label and the table tag's respective roles:
<form> Tag role:
<form> tags are used to create HTML forms for user input.
1. The form can contain input elements such as text fields, checkboxes, radio boxes, submit buttons, and so on.
2. The form can also contain menus, textarea, fieldset, legend, and label elements.
3. The form is used to transfer data to the server.
Note: A form element is a block-level element that produces a folded line before and after it.
Here's an example to prove that:
<form action= "form_action.asp" method= "get" > <p>first name: <input type= "text" name= "FName"/></p > <p>last Name: <input type= "text" name= "lname"/></p> <input type= "Submit" value= "Submit"/> </form>
<table> Tag role:
<table> tags define HTML tables.
1. A simple HTML table consists of a TABLE element and one or more tr, TH, or TD elements.
The TR element defines the table row, the th element defines the header, and the TD element defines the table cell.
2. More complex HTML tables may also include caption, Col, Colgroup, THEAD, TFOOT, and tbody elements.
Here's an example: a simple HTML table with two rows and two columns:
<table border= "1" > <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table>
This is the end of this article, if you have any questions, please leave a message below