0
4.2kviews
Explain following HTML tags : i) <form> ii) <table> iii) <iframe> iv) <doctype>
1 Answer
0
47views

The <form> Tag

  • The basic goal of <form> tag is to allow the user to enter data on one side and then send this data on other side through web server.
  • All of the controls of form appear within the opening <form> and closing </form>
  • <form> tag can have several different attributes, only one of which ‘action’ is more important and required because action attribute specifies the URL of the application on the web server that is to be called when user click on the submit button.
  • Method attribute of <form> tag represents the HTTP method that sends the data to the action URL. The default value for the method attribute is get.
  • The <form> element can contain one or more of the following form elements: <input>, <textarea>, <button>, <select>, <option>, <optgroup>, <fieldset>, <label>
  • Example:

    <form action=" " method="get"> First name: <input type="text" name="fname"><br><br> Last name: <input type="text" name="lname"><br><br> <input type="submit" value="Submit"> </form>

  • Output:

Form Output

The <table> Tag

  • <table> tag is used to create a table. This tag useful to display information in more than one dimension means in tabular format.
  • A table consists of columns and rows where each row is divided into several data cells.
  • A cell can contain text, lists, images, forms and other tables too.
  • Tags used within opening <table> and closing </table> are as follow
  • <th> - To create header cell in a table
  • <tr> - To create rows in a table
  • <td> - To create cell in a table
  • <caption>- Specifies the caption of table
  • <colgroup> - Specifies a group of one or more columns in table
  • <col> - Specifies column properties for each column within a <colgroup>
  • <thead> - Groups the header content in a table
  • <tbody> - Groups the body content in a table
  • <tfoot> - Groups the footer content in table
  • Example:

    <table border=”3”> <tr><th>Month</th><th>Balance</th> </tr> <tr><td>January</td><td>10000</td> </tr> <tr> <td>February</td> <td>20000</td></tr> </table>

  • Output:

Table Output

The <iframe> Tag

  • The <iframe> tag specifies an inline frame.
  • The <iframe> tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders.
  • An inline frame is used to embed another document within the current HTML document.
  • The <iframe> tag is not somehow related to <frameset> tag, instead, it can appear anywhere in the document.
  • IFrame behaves like an inline image; it can be configured with its own scrollbar independent of the surrounding page's scrollbar.
  • Example: <iframe src="https://www.ques10.com"></iframe>

The <doctype> Tag

  • The <!DOCTYPE> declaration must be the very first thing in the HTML document, before the <html> tag.
  • The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.
  • In HTML 4.01, it also specifies the Document Type Definition (DTD) used by document. A DTD is a separate file containing formal definition of grammar, such as supported elements and attributes used in the markup language.
  • HTML 5 is not based on SGML, and therefore does not require a reference to a DTD.
  • The browser checks the code of the document against the rule in the <!DOCTYPE> declaration.
  • In HTML 5 there is only one <!DOCTYPE> declaration.
  • The <!DOCTYPE> does not have a closing tag.
Please log in to add an answer.