KEMBAR78
Tables and Forms in HTML | PPT
HTML – Tables and Forms Doncho Minkov Telerik Mobile Development Course mobiledevcourse.telerik.com Technical Trainer http://www.minkov.it
Contents  HTML Tables Nested Tables Cells Width Cell Spacing and Padding Column and Row Span
Contents (2) HTML Forms Form Fields and Fieldsets Form Controls and Labels Text field Text area Select Radio button Checkbox Button Image button
HTML Tables
HTML Tables Tables represent tabular data A table consists of one or several rows Each row has one or more columns Tables comprised of several core tags:  <table></table> : begin / end the table <tr></tr> :  create a table row <td></td> : create tabular data (cell) Tables should not be used for layout. Use CSS floats and positioning styles instead
Simple HTML Tables – Example <table cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;> <tr> <td><img src=&quot;ppt.gif&quot;></td> <td><a href=&quot;lecture1.ppt&quot;>Lecture 1</a></td> </tr> <tr> <td><img src=&quot;ppt.gif&quot;></td> <td><a href=&quot;lecture2.ppt&quot;>Lecture 2</a></td> </tr> <tr> <td><img src=&quot;zip.gif&quot;></td> <td><a href=&quot;lecture2-demos.zip&quot;> Lecture 2 - Demos</a></td> </tr> </table>
Simple HTML Tables Live Demo
Complete HTML Tables Table rows split into three semantic sections: header, body and footer <thead>  denotes table header and contains  <th>  elements, instead of  <td>  elements <tbody>  denotes collection of table rows that contain the very data <tfoot>  denotes table footer but comes BEFORE the  <tbody>  tag <colgroup>  and  <col>  define columns (used to set column widths)
Complete HTML Table: Example <table> <colgroup> <col style=&quot;width:100px&quot; /><col /> </colgroup> <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead> <tfoot> <tr><td>Footer 1</td><td>Footer 2</td></tr> </tfoot> <tbody> <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr> <tr><td>Cell 2.1</td><td>Cell 2.2</td></tr> </tbody> </table> header footer Last comes the body (data) th columns
Complete HTML Table: Example (2) <table> <colgroup> <col style=&quot;width:200px&quot; /><col /> </colgroup> <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead> <tfoot> <tr><td>Footer 1</td><td>Footer 2</td></tr> </tfoot> <tbody> <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr> <tr><td>Cell 2.1</td><td>Cell 2.2</td></tr> </tbody> </table> table-full.html Although the footer is before the data in the code, it is displayed last By default, header text is bold and centered.
Nested Tables Table data “cells” ( <td> ) can contain nested tables (tables within tables): <table> <tr> <td>Contact:</td> <td> <table> <tr> <td>First Name</td> <td>Last Name</td> </tr> </table> </td> </tr> </table> nested-tables.html
Nested Tables Live Demo
Cell Spacing and Padding Tables have two attributes related to space cellpadding Defines the empty space around the cell content cellspacing Defines the empty space between cells cell cell cell cell cell cell cell cell
Cell Spacing and Padding – Example <html> <head><title>Table Cells</title></head> <body> <table  cellspacing=&quot;15&quot; cellpadding=&quot;0&quot; > <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing=&quot;0&quot; cellpadding=&quot;10&quot;> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> table- cells .html
Cell Spacing and Padding – Example (2) <html> <head><title>Table Cells</title></head> <body> <table  cellspacing=&quot;15&quot; cellpadding=&quot;0&quot; > <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing=&quot;0&quot; cellpadding=&quot;10&quot;> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> table- cells .html
Table Cell Spacing and Cell Padding Live Demo
Column and Row Span Cells have two attributes related to merging rowspan Defines how many rows the cell occupies colspan Defines how many columns the cell occupies cell[1,1] cell[1,2] cell[2,1] colspan=&quot;1&quot; colspan=&quot;1&quot; colspan=&quot;2&quot; cell[1,1] cell[1,2] cell[2,1] rowspan=&quot;2&quot; rowspan=&quot;1&quot; rowspan=&quot;1&quot;
Column and Row Span – Example <table cellspacing=&quot;0&quot;> <tr class=&quot;1&quot;><td>Cell[1,1]</td> <td  colspan=&quot;2&quot; >Cell[2,1]</td></tr> <tr class=“2&quot;><td>Cell[1,2]</td> <td  rowspan=&quot;2&quot; >Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr class=“3&quot;><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> table-colspan-rowspan.html
Column and Row Span – Example (2) <table cellspacing=&quot;0&quot;> <tr class=&quot;1&quot;><td>Cell[1,1]</td> <td  colspan=&quot;2&quot; >Cell[2,1]</td></tr> <tr class=“2&quot;><td>Cell[1,2]</td> <td  rowspan=&quot;2&quot; >Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr class=“3&quot;><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> table-colspan-rowspan.html Cell[2,3] Cell[1,3] Cell[3,2] Cell[2,2] Cell[1,2] Cell[2,1] Cell[1,1]
HTML Forms Entering User Data from a Web Page
HTML Forms Forms are the primary method for gathering data from site visitors Create a form block with Example: <form></form> <form name=&quot;myForm&quot; method=&quot;post&quot; action=&quot;path/to/some-script.php&quot;> ... </form> The &quot;action&quot; attribute tells where the form data should be sent The “method&quot; attribute tells how the form data should be sent – via GET or POST request
Form Fields Single-line text input fields: Multi-line textarea fields: Hidden fields contain data not shown to the user: Used by JavaScript and server-side code <input type=&quot;text&quot; name=&quot;FirstName&quot; value=&quot;This is a text field&quot; /> <textarea name=&quot;Comments&quot;>This is a multi-line text field</textarea> <input type=&quot;hidden&quot; name=&quot;Account&quot; value=&quot;This is a hidden text field&quot; />
Fieldsets Fieldsets  are used to enclose a group of related form fields: The  <legend>  is the fieldset's title. <form method=&quot;post&quot; action=&quot;form.aspx&quot;> <fieldset> <legend>Client Details</legend> <input type=&quot;text&quot; id=&quot;Name&quot; /> <input type=&quot;text&quot; id=&quot;Phone&quot; /> </fieldset> <fieldset> <legend>Order Details</legend> <input type=&quot;text&quot; id=&quot;Quantity&quot; /> <textarea cols=&quot;40&quot; rows=&quot;10&quot;   id=&quot;Remarks&quot;></textarea> </fieldset> </form>
Form Input Controls Checkboxes: Radio buttons: Radio buttons can be grouped, allowing only one to be selected from a group: <input type=&quot;checkbox&quot; name=&quot;fruit&quot; value=&quot;apple&quot; /> <input type=&quot;radio&quot; name=&quot;title&quot; value=&quot;Mr.&quot; /> <input type=&quot;radio&quot; name=&quot; city &quot; value=&quot;Lom&quot; /> <input type=&quot;radio&quot; name=&quot; city &quot; value=&quot;Ruse&quot; />
Other Form Controls Dropdown menus: Submit button: <select name=&quot;gender&quot;> <option value=&quot;Value 1&quot; selected=&quot;selected&quot;>Male</option> <option value=&quot;Value 2&quot;>Female</option> <option value=&quot;Value 3&quot;>Other</option> </select> <input type=&quot;submit&quot; name=&quot;submitBtn&quot; value=&quot;Apply Now&quot; />
Other Form Controls (2) Reset button – brings the form to its initial state Image button – acts like submit but image is displayed and click coordinates are sent Ordinary button – used for Javascript, no default action <input type=&quot;reset&quot; name=&quot;resetBtn&quot; value=&quot;Reset the form&quot; /> <input type=&quot;image&quot; src=&quot;submit.gif&quot; name=&quot;submitBtn&quot; alt=&quot;Submit&quot; /> <input type=&quot;button&quot; value=&quot;click me&quot; />
Other Form Controls (3) Password input – a text field which masks the entered text with * signs Multiple select field – displays the list of items in multiple lines, instead of one <input type=&quot;password&quot; name=&quot;pass&quot; /> <select name=&quot;products&quot; multiple=&quot;multiple&quot;> <option value=&quot;Value 1&quot; selected=&quot;selected&quot;>keyboard</option> <option value=&quot;Value 2&quot;>mouse</option> <option value=&quot;Value 3&quot;>speakers</option> </select>
Other Form Controls (4) File input – a field used for uploading files When used, it requires the form element to have a specific attribute: <input type=&quot;file&quot; name=&quot;photo&quot; /> <form enctype=&quot;multipart/form-data&quot;> ... <input type=&quot;file&quot; name=&quot;photo&quot; /> ... </form>
Labels Form labels are used to associate an explanatory text to a form field using the field's ID. Clicking on a label focuses its associated field (checkboxes are toggled, radio buttons are checked) Labels are both a usability and accessibility feature and are required in order to pass accessibility validation. <label for=&quot;fn&quot;>First Name</label> <input type=&quot;text&quot; id=&quot;fn&quot; />
HTML Forms – Example <form method=&quot;post&quot; action=&quot;apply-now.php&quot;> <input name=&quot;subject&quot; type=&quot;hidden&quot; value=&quot;Class&quot; /> <fieldset><legend>Academic information</legend> <label for=&quot;degree&quot;>Degree</label> <select name=&quot;degree&quot; id=&quot;degree&quot;> <option value=&quot;BA&quot;>Bachelor of Art</option> <option value=&quot;BS&quot;>Bachelor of Science</option> <option value=&quot;MBA&quot; selected=&quot;selected&quot;>Master of Business Administration</option> </select> <br /> <label for=&quot;studentid&quot;>Student ID</label> <input type=&quot;password&quot; name=&quot;studentid&quot; /> </fieldset> <fieldset><legend>Personal Details</legend> <label for=&quot;fname&quot;>First Name</label> <input type=&quot;text&quot; name=&quot;fname&quot; id=&quot;fname&quot; /> <br /> <label for=&quot;lname&quot;>Last Name</label> <input type=&quot;text&quot; name=&quot;lname&quot; id=&quot;lname&quot; /> form.html
HTML Forms – Example (2) <br /> Gender:  <input name=&quot;gender&quot; type=&quot;radio&quot; id=&quot;gm&quot; value=&quot;m&quot; /> <label for=&quot;gm&quot;>Male</label> <input name=&quot;gender&quot; type=&quot;radio&quot; id=&quot;gf&quot; value=&quot;f&quot; /> <label for=&quot;gf&quot;>Female</label> <br /> <label for=&quot;email&quot;>Email</label> <input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; /> </fieldset> <p> <textarea name=&quot;terms&quot; cols=&quot;30&quot; rows=&quot;4&quot; readonly=&quot;readonly&quot;>TERMS AND CONDITIONS...</textarea> </p> <p> <input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Send Form&quot; /> <input type=&quot;reset&quot; value=&quot;Clear Form&quot; /> </p> </form> form.html (continued)
HTML Forms – Example (3) form.html (continued)
TabIndex The tabindex HTML attribute controls the order in which form fields and hyperlinks are focused when repeatedly pressing the TAB key tabindex=&quot;0&quot; (zero) - &quot;natural&quot; order If X > Y, then elements with tabindex=&quot;X&quot; are iterated before elements with tabindex=&quot;Y&quot; Elements with negative tabindex are skipped, however, this is not defined in the standard <input type=&quot;text&quot; tabindex=&quot;10&quot; />
HTML Frames <frameset> ,  <frame>  and  <iframe>
HTML Frames Frames  provide a way to show multiple HTML documents in a single Web page The page can be split into separate views (frames) horizontally and vertically Frames were popular in the early ages of HTML development, but now their usage is rejected Frames are not supported by all user agents (browsers, search engines, etc.) A  < noframes >  element is used to provide content for non-compatible agents.
HTML Frames – Demo <html> <head><title>Frames Example</title></head> <frameset cols=&quot;180px,*,150px&quot;> <frame src=&quot;left.html&quot; /> <frame src=&quot;middle.html&quot; /> <frame src=&quot;right.html&quot; /> </frameset> </html> frames.html Note the  target  attribute applied to the  <a>  elements in the left frame.
Inline Frames:  <iframe> Inline frames  provide a way to show one website inside another website: <iframe name=&quot;iframeGoogle&quot; width=&quot;600&quot; height=&quot;400&quot; src=&quot;http://www.google.com&quot; frameborder=&quot;yes&quot; scrolling=&quot;yes&quot;></iframe> iframe-demo.html
HTML – Tables and Forms Questions? http://academy.telerik.com
Exercises Create Web Pages like the following using tables: Create a Web Page like the following using forms:
Exercises (2) Create a Web form that looks like this sample: See the image  Sample-form.png

Tables and Forms in HTML

  • 1.
    HTML – Tablesand Forms Doncho Minkov Telerik Mobile Development Course mobiledevcourse.telerik.com Technical Trainer http://www.minkov.it
  • 2.
    Contents HTMLTables Nested Tables Cells Width Cell Spacing and Padding Column and Row Span
  • 3.
    Contents (2) HTMLForms Form Fields and Fieldsets Form Controls and Labels Text field Text area Select Radio button Checkbox Button Image button
  • 4.
  • 5.
    HTML Tables Tablesrepresent tabular data A table consists of one or several rows Each row has one or more columns Tables comprised of several core tags: <table></table> : begin / end the table <tr></tr> : create a table row <td></td> : create tabular data (cell) Tables should not be used for layout. Use CSS floats and positioning styles instead
  • 6.
    Simple HTML Tables– Example <table cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;> <tr> <td><img src=&quot;ppt.gif&quot;></td> <td><a href=&quot;lecture1.ppt&quot;>Lecture 1</a></td> </tr> <tr> <td><img src=&quot;ppt.gif&quot;></td> <td><a href=&quot;lecture2.ppt&quot;>Lecture 2</a></td> </tr> <tr> <td><img src=&quot;zip.gif&quot;></td> <td><a href=&quot;lecture2-demos.zip&quot;> Lecture 2 - Demos</a></td> </tr> </table>
  • 7.
  • 8.
    Complete HTML TablesTable rows split into three semantic sections: header, body and footer <thead> denotes table header and contains <th> elements, instead of <td> elements <tbody> denotes collection of table rows that contain the very data <tfoot> denotes table footer but comes BEFORE the <tbody> tag <colgroup> and <col> define columns (used to set column widths)
  • 9.
    Complete HTML Table:Example <table> <colgroup> <col style=&quot;width:100px&quot; /><col /> </colgroup> <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead> <tfoot> <tr><td>Footer 1</td><td>Footer 2</td></tr> </tfoot> <tbody> <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr> <tr><td>Cell 2.1</td><td>Cell 2.2</td></tr> </tbody> </table> header footer Last comes the body (data) th columns
  • 10.
    Complete HTML Table:Example (2) <table> <colgroup> <col style=&quot;width:200px&quot; /><col /> </colgroup> <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead> <tfoot> <tr><td>Footer 1</td><td>Footer 2</td></tr> </tfoot> <tbody> <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr> <tr><td>Cell 2.1</td><td>Cell 2.2</td></tr> </tbody> </table> table-full.html Although the footer is before the data in the code, it is displayed last By default, header text is bold and centered.
  • 11.
    Nested Tables Tabledata “cells” ( <td> ) can contain nested tables (tables within tables): <table> <tr> <td>Contact:</td> <td> <table> <tr> <td>First Name</td> <td>Last Name</td> </tr> </table> </td> </tr> </table> nested-tables.html
  • 12.
  • 13.
    Cell Spacing andPadding Tables have two attributes related to space cellpadding Defines the empty space around the cell content cellspacing Defines the empty space between cells cell cell cell cell cell cell cell cell
  • 14.
    Cell Spacing andPadding – Example <html> <head><title>Table Cells</title></head> <body> <table cellspacing=&quot;15&quot; cellpadding=&quot;0&quot; > <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing=&quot;0&quot; cellpadding=&quot;10&quot;> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> table- cells .html
  • 15.
    Cell Spacing andPadding – Example (2) <html> <head><title>Table Cells</title></head> <body> <table cellspacing=&quot;15&quot; cellpadding=&quot;0&quot; > <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing=&quot;0&quot; cellpadding=&quot;10&quot;> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> table- cells .html
  • 16.
    Table Cell Spacingand Cell Padding Live Demo
  • 17.
    Column and RowSpan Cells have two attributes related to merging rowspan Defines how many rows the cell occupies colspan Defines how many columns the cell occupies cell[1,1] cell[1,2] cell[2,1] colspan=&quot;1&quot; colspan=&quot;1&quot; colspan=&quot;2&quot; cell[1,1] cell[1,2] cell[2,1] rowspan=&quot;2&quot; rowspan=&quot;1&quot; rowspan=&quot;1&quot;
  • 18.
    Column and RowSpan – Example <table cellspacing=&quot;0&quot;> <tr class=&quot;1&quot;><td>Cell[1,1]</td> <td colspan=&quot;2&quot; >Cell[2,1]</td></tr> <tr class=“2&quot;><td>Cell[1,2]</td> <td rowspan=&quot;2&quot; >Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr class=“3&quot;><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> table-colspan-rowspan.html
  • 19.
    Column and RowSpan – Example (2) <table cellspacing=&quot;0&quot;> <tr class=&quot;1&quot;><td>Cell[1,1]</td> <td colspan=&quot;2&quot; >Cell[2,1]</td></tr> <tr class=“2&quot;><td>Cell[1,2]</td> <td rowspan=&quot;2&quot; >Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr class=“3&quot;><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> table-colspan-rowspan.html Cell[2,3] Cell[1,3] Cell[3,2] Cell[2,2] Cell[1,2] Cell[2,1] Cell[1,1]
  • 20.
    HTML Forms EnteringUser Data from a Web Page
  • 21.
    HTML Forms Formsare the primary method for gathering data from site visitors Create a form block with Example: <form></form> <form name=&quot;myForm&quot; method=&quot;post&quot; action=&quot;path/to/some-script.php&quot;> ... </form> The &quot;action&quot; attribute tells where the form data should be sent The “method&quot; attribute tells how the form data should be sent – via GET or POST request
  • 22.
    Form Fields Single-linetext input fields: Multi-line textarea fields: Hidden fields contain data not shown to the user: Used by JavaScript and server-side code <input type=&quot;text&quot; name=&quot;FirstName&quot; value=&quot;This is a text field&quot; /> <textarea name=&quot;Comments&quot;>This is a multi-line text field</textarea> <input type=&quot;hidden&quot; name=&quot;Account&quot; value=&quot;This is a hidden text field&quot; />
  • 23.
    Fieldsets Fieldsets are used to enclose a group of related form fields: The <legend> is the fieldset's title. <form method=&quot;post&quot; action=&quot;form.aspx&quot;> <fieldset> <legend>Client Details</legend> <input type=&quot;text&quot; id=&quot;Name&quot; /> <input type=&quot;text&quot; id=&quot;Phone&quot; /> </fieldset> <fieldset> <legend>Order Details</legend> <input type=&quot;text&quot; id=&quot;Quantity&quot; /> <textarea cols=&quot;40&quot; rows=&quot;10&quot; id=&quot;Remarks&quot;></textarea> </fieldset> </form>
  • 24.
    Form Input ControlsCheckboxes: Radio buttons: Radio buttons can be grouped, allowing only one to be selected from a group: <input type=&quot;checkbox&quot; name=&quot;fruit&quot; value=&quot;apple&quot; /> <input type=&quot;radio&quot; name=&quot;title&quot; value=&quot;Mr.&quot; /> <input type=&quot;radio&quot; name=&quot; city &quot; value=&quot;Lom&quot; /> <input type=&quot;radio&quot; name=&quot; city &quot; value=&quot;Ruse&quot; />
  • 25.
    Other Form ControlsDropdown menus: Submit button: <select name=&quot;gender&quot;> <option value=&quot;Value 1&quot; selected=&quot;selected&quot;>Male</option> <option value=&quot;Value 2&quot;>Female</option> <option value=&quot;Value 3&quot;>Other</option> </select> <input type=&quot;submit&quot; name=&quot;submitBtn&quot; value=&quot;Apply Now&quot; />
  • 26.
    Other Form Controls(2) Reset button – brings the form to its initial state Image button – acts like submit but image is displayed and click coordinates are sent Ordinary button – used for Javascript, no default action <input type=&quot;reset&quot; name=&quot;resetBtn&quot; value=&quot;Reset the form&quot; /> <input type=&quot;image&quot; src=&quot;submit.gif&quot; name=&quot;submitBtn&quot; alt=&quot;Submit&quot; /> <input type=&quot;button&quot; value=&quot;click me&quot; />
  • 27.
    Other Form Controls(3) Password input – a text field which masks the entered text with * signs Multiple select field – displays the list of items in multiple lines, instead of one <input type=&quot;password&quot; name=&quot;pass&quot; /> <select name=&quot;products&quot; multiple=&quot;multiple&quot;> <option value=&quot;Value 1&quot; selected=&quot;selected&quot;>keyboard</option> <option value=&quot;Value 2&quot;>mouse</option> <option value=&quot;Value 3&quot;>speakers</option> </select>
  • 28.
    Other Form Controls(4) File input – a field used for uploading files When used, it requires the form element to have a specific attribute: <input type=&quot;file&quot; name=&quot;photo&quot; /> <form enctype=&quot;multipart/form-data&quot;> ... <input type=&quot;file&quot; name=&quot;photo&quot; /> ... </form>
  • 29.
    Labels Form labelsare used to associate an explanatory text to a form field using the field's ID. Clicking on a label focuses its associated field (checkboxes are toggled, radio buttons are checked) Labels are both a usability and accessibility feature and are required in order to pass accessibility validation. <label for=&quot;fn&quot;>First Name</label> <input type=&quot;text&quot; id=&quot;fn&quot; />
  • 30.
    HTML Forms –Example <form method=&quot;post&quot; action=&quot;apply-now.php&quot;> <input name=&quot;subject&quot; type=&quot;hidden&quot; value=&quot;Class&quot; /> <fieldset><legend>Academic information</legend> <label for=&quot;degree&quot;>Degree</label> <select name=&quot;degree&quot; id=&quot;degree&quot;> <option value=&quot;BA&quot;>Bachelor of Art</option> <option value=&quot;BS&quot;>Bachelor of Science</option> <option value=&quot;MBA&quot; selected=&quot;selected&quot;>Master of Business Administration</option> </select> <br /> <label for=&quot;studentid&quot;>Student ID</label> <input type=&quot;password&quot; name=&quot;studentid&quot; /> </fieldset> <fieldset><legend>Personal Details</legend> <label for=&quot;fname&quot;>First Name</label> <input type=&quot;text&quot; name=&quot;fname&quot; id=&quot;fname&quot; /> <br /> <label for=&quot;lname&quot;>Last Name</label> <input type=&quot;text&quot; name=&quot;lname&quot; id=&quot;lname&quot; /> form.html
  • 31.
    HTML Forms –Example (2) <br /> Gender: <input name=&quot;gender&quot; type=&quot;radio&quot; id=&quot;gm&quot; value=&quot;m&quot; /> <label for=&quot;gm&quot;>Male</label> <input name=&quot;gender&quot; type=&quot;radio&quot; id=&quot;gf&quot; value=&quot;f&quot; /> <label for=&quot;gf&quot;>Female</label> <br /> <label for=&quot;email&quot;>Email</label> <input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; /> </fieldset> <p> <textarea name=&quot;terms&quot; cols=&quot;30&quot; rows=&quot;4&quot; readonly=&quot;readonly&quot;>TERMS AND CONDITIONS...</textarea> </p> <p> <input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Send Form&quot; /> <input type=&quot;reset&quot; value=&quot;Clear Form&quot; /> </p> </form> form.html (continued)
  • 32.
    HTML Forms –Example (3) form.html (continued)
  • 33.
    TabIndex The tabindexHTML attribute controls the order in which form fields and hyperlinks are focused when repeatedly pressing the TAB key tabindex=&quot;0&quot; (zero) - &quot;natural&quot; order If X > Y, then elements with tabindex=&quot;X&quot; are iterated before elements with tabindex=&quot;Y&quot; Elements with negative tabindex are skipped, however, this is not defined in the standard <input type=&quot;text&quot; tabindex=&quot;10&quot; />
  • 34.
    HTML Frames <frameset>, <frame> and <iframe>
  • 35.
    HTML Frames Frames provide a way to show multiple HTML documents in a single Web page The page can be split into separate views (frames) horizontally and vertically Frames were popular in the early ages of HTML development, but now their usage is rejected Frames are not supported by all user agents (browsers, search engines, etc.) A < noframes > element is used to provide content for non-compatible agents.
  • 36.
    HTML Frames –Demo <html> <head><title>Frames Example</title></head> <frameset cols=&quot;180px,*,150px&quot;> <frame src=&quot;left.html&quot; /> <frame src=&quot;middle.html&quot; /> <frame src=&quot;right.html&quot; /> </frameset> </html> frames.html Note the target attribute applied to the <a> elements in the left frame.
  • 37.
    Inline Frames: <iframe> Inline frames provide a way to show one website inside another website: <iframe name=&quot;iframeGoogle&quot; width=&quot;600&quot; height=&quot;400&quot; src=&quot;http://www.google.com&quot; frameborder=&quot;yes&quot; scrolling=&quot;yes&quot;></iframe> iframe-demo.html
  • 38.
    HTML – Tablesand Forms Questions? http://academy.telerik.com
  • 39.
    Exercises Create WebPages like the following using tables: Create a Web Page like the following using forms:
  • 40.
    Exercises (2) Createa Web form that looks like this sample: See the image Sample-form.png

Editor's Notes

  • #6 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #8 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #12 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #13 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #14 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #15 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #16 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #17 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #18 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #19 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #20 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #21 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #22 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #23 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #24 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #25 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #26 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #31 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #32 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #33 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  • #34 * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##