SlideShare a Scribd company logo
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

More Related Content

What's hot (20)

PPTX
HTML: Tables and Forms
BG Java EE Course
 
PPTX
Basic HTML
Sayan De
 
PPTX
Html ppt
santosh lamba
 
PDF
jQuery for beginners
Arulmurugan Rajaraman
 
PDF
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
PPTX
Basic html structure
Jhaun Paul Enriquez
 
PDF
Div tag presentation
alyssa_lum11
 
PPT
Learning Html
Damian Gonz
 
PPTX
Tables and Forms in HTML
Marlon Jamera
 
PPT
Html Slide Part-1
AAKASH KUMAR
 
PPT
CSS Basics
WordPress Memphis
 
PDF
Html tables examples
Mukesh Tekwani
 
PDF
Html forms
eShikshak
 
PPTX
HTML, CSS and Java Scripts Basics
Sun Technlogies
 
PPTX
(Fast) Introduction to HTML & CSS
Dave Kelly
 
PDF
Intro to HTML & CSS
Syed Sami
 
PPTX
Html Table
nehashinde41
 
PPSX
HTML5 - Forms
tina1357
 
PPTX
HTML Table Tags
Kainat Ilyas
 
PPT
Introduction to html
vikasgaur31
 
HTML: Tables and Forms
BG Java EE Course
 
Basic HTML
Sayan De
 
Html ppt
santosh lamba
 
jQuery for beginners
Arulmurugan Rajaraman
 
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
Basic html structure
Jhaun Paul Enriquez
 
Div tag presentation
alyssa_lum11
 
Learning Html
Damian Gonz
 
Tables and Forms in HTML
Marlon Jamera
 
Html Slide Part-1
AAKASH KUMAR
 
CSS Basics
WordPress Memphis
 
Html tables examples
Mukesh Tekwani
 
Html forms
eShikshak
 
HTML, CSS and Java Scripts Basics
Sun Technlogies
 
(Fast) Introduction to HTML & CSS
Dave Kelly
 
Intro to HTML & CSS
Syed Sami
 
Html Table
nehashinde41
 
HTML5 - Forms
tina1357
 
HTML Table Tags
Kainat Ilyas
 
Introduction to html
vikasgaur31
 

Viewers also liked (20)

PPTX
HTML Forms
Ravinder Kamboj
 
PDF
2. HTML forms
Pavle Đorđević
 
PPTX
Web engineering - Measuring Effort Prediction Power and Accuracy
Nosheen Qamar
 
PPTX
Web Engineering - Web Application Testing
Nosheen Qamar
 
PPT
IWMW 1999: SMIL and the world smiles with you
IWMW
 
PPT
SMIL it should all be open and on the Internet
signagelive
 
PPT
Podcasting & SMIL
Adrian Stevenson
 
PPTX
Web engineering - An overview about HTML
Nosheen Qamar
 
PPTX
Web Engineering - Introduction to CSS
Nosheen Qamar
 
PDF
PROGRESS - CSS BASIC
UKM PROGRESS
 
PPTX
Web engineering - HTML Form
Nosheen Qamar
 
PPTX
Need for Web Engineering
Nosheen Qamar
 
PDF
Open Source and Open Data in the Age of the Cloud
Tim O'Reilly
 
PPTX
Angular js for beginners
Munir Hoque
 
PDF
[Basic HTML/CSS] 4. html - form tags
Hyejin Oh
 
PDF
[Basic HTML/CSS] 3. html - table tags
Hyejin Oh
 
PPTX
Web Engineering - Basic CSS Properties
Nosheen Qamar
 
PDF
Basic css-tutorial
mohamed ashraf
 
PPTX
Web engineering lecture 1
University of Swat
 
HTML Forms
Ravinder Kamboj
 
2. HTML forms
Pavle Đorđević
 
Web engineering - Measuring Effort Prediction Power and Accuracy
Nosheen Qamar
 
Web Engineering - Web Application Testing
Nosheen Qamar
 
IWMW 1999: SMIL and the world smiles with you
IWMW
 
SMIL it should all be open and on the Internet
signagelive
 
Podcasting & SMIL
Adrian Stevenson
 
Web engineering - An overview about HTML
Nosheen Qamar
 
Web Engineering - Introduction to CSS
Nosheen Qamar
 
PROGRESS - CSS BASIC
UKM PROGRESS
 
Web engineering - HTML Form
Nosheen Qamar
 
Need for Web Engineering
Nosheen Qamar
 
Open Source and Open Data in the Age of the Cloud
Tim O'Reilly
 
Angular js for beginners
Munir Hoque
 
[Basic HTML/CSS] 4. html - form tags
Hyejin Oh
 
[Basic HTML/CSS] 3. html - table tags
Hyejin Oh
 
Web Engineering - Basic CSS Properties
Nosheen Qamar
 
Basic css-tutorial
mohamed ashraf
 
Web engineering lecture 1
University of Swat
 
Ad

Similar to Tables and Forms in HTML (20)

PPT
HTML 5 Tables and Forms
Doncho Minkov
 
DOC
Handout5 tables
Nadine Guevarra
 
PPT
3.1 xhtml tables
Bulldogs83
 
PPTX
Html tables
Himanshu Pathak
 
PDF
HTML Lecture Part 2 of 2
Sharon Wasden
 
PPTX
1 06-more html-elements
apnwebdev
 
PPTX
1-06: More HTML Elements
apnwebdev
 
PPTX
Web design - Working with tables in HTML
Mustafa Kamel Mohammadi
 
PPTX
Tables and their padding in HTML etc.pptx
SALT13
 
PPTX
Table structure introduction
nobel mujuji
 
PPTX
01 HTML-Tables-1.pptx
AhmedAlmughalis1
 
PPTX
WEP4 and 5.pptx
MLikithMahendra
 
PPT
Tables overview 2010
Mark Carter
 
ODP
Html tut 04
Maxie Santos
 
PDF
Web I - 03 - Tables
Randy Connolly
 
PPTX
Html - Tables, Forms and Frames by Telerik Academy
Ognyan Penkov
 
PPT
4.3 table styling
Bulldogs83
 
PPT
Tables of html sebagai bahan untuk membuat tabel.ppt
MacHroz Mac
 
HTML 5 Tables and Forms
Doncho Minkov
 
Handout5 tables
Nadine Guevarra
 
3.1 xhtml tables
Bulldogs83
 
Html tables
Himanshu Pathak
 
HTML Lecture Part 2 of 2
Sharon Wasden
 
1 06-more html-elements
apnwebdev
 
1-06: More HTML Elements
apnwebdev
 
Web design - Working with tables in HTML
Mustafa Kamel Mohammadi
 
Tables and their padding in HTML etc.pptx
SALT13
 
Table structure introduction
nobel mujuji
 
01 HTML-Tables-1.pptx
AhmedAlmughalis1
 
WEP4 and 5.pptx
MLikithMahendra
 
Tables overview 2010
Mark Carter
 
Html tut 04
Maxie Santos
 
Web I - 03 - Tables
Randy Connolly
 
Html - Tables, Forms and Frames by Telerik Academy
Ognyan Penkov
 
4.3 table styling
Bulldogs83
 
Tables of html sebagai bahan untuk membuat tabel.ppt
MacHroz Mac
 
Ad

More from Doncho Minkov (20)

PDF
Web Design Concepts
Doncho Minkov
 
PPT
Web design Tools
Doncho Minkov
 
PPT
HTML 5
Doncho Minkov
 
PPT
CSS Overview
Doncho Minkov
 
PPT
CSS Presentation
Doncho Minkov
 
PPT
CSS Layout
Doncho Minkov
 
PPT
CSS 3
Doncho Minkov
 
PPT
Adobe Photoshop
Doncho Minkov
 
PPT
Slice and Dice
Doncho Minkov
 
PPT
Introduction to XAML and WPF
Doncho Minkov
 
PPT
WPF Layout Containers
Doncho Minkov
 
PPT
WPF Controls
Doncho Minkov
 
PPT
WPF Templating and Styling
Doncho Minkov
 
PPT
WPF Graphics and Animations
Doncho Minkov
 
PPT
Simple Data Binding
Doncho Minkov
 
PPT
Complex Data Binding
Doncho Minkov
 
PPT
WPF Concepts
Doncho Minkov
 
PPT
Model View ViewModel
Doncho Minkov
 
PPT
WPF and Databases
Doncho Minkov
 
PPT
Introduction to Cross-platform Mobile Development Course
Doncho Minkov
 
Web Design Concepts
Doncho Minkov
 
Web design Tools
Doncho Minkov
 
CSS Overview
Doncho Minkov
 
CSS Presentation
Doncho Minkov
 
CSS Layout
Doncho Minkov
 
Adobe Photoshop
Doncho Minkov
 
Slice and Dice
Doncho Minkov
 
Introduction to XAML and WPF
Doncho Minkov
 
WPF Layout Containers
Doncho Minkov
 
WPF Controls
Doncho Minkov
 
WPF Templating and Styling
Doncho Minkov
 
WPF Graphics and Animations
Doncho Minkov
 
Simple Data Binding
Doncho Minkov
 
Complex Data Binding
Doncho Minkov
 
WPF Concepts
Doncho Minkov
 
Model View ViewModel
Doncho Minkov
 
WPF and Databases
Doncho Minkov
 
Introduction to Cross-platform Mobile Development Course
Doncho Minkov
 

Recently uploaded (20)

PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
July Patch Tuesday
Ivanti
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
July Patch Tuesday
Ivanti
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 

Tables and Forms in HTML

  • 1. HTML – Tables and Forms Doncho Minkov Telerik Mobile Development Course mobiledevcourse.telerik.com Technical Trainer http://www.minkov.it
  • 2. Contents HTML Tables Nested Tables Cells Width Cell Spacing and Padding Column and Row Span
  • 3. Contents (2) HTML Forms Form Fields and Fieldsets Form Controls and Labels Text field Text area Select Radio button Checkbox Button Image button
  • 5. 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
  • 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. Simple HTML Tables Live Demo
  • 8. 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)
  • 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 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
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. Table Cell Spacing and Cell Padding Live Demo
  • 17. 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;
  • 18. 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
  • 19. 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]
  • 20. HTML Forms Entering User Data from a Web Page
  • 21. 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
  • 22. 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; />
  • 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 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; />
  • 25. 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; />
  • 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 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; />
  • 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 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; />
  • 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 – Tables and Forms Questions? http://academy.telerik.com
  • 39. Exercises Create Web Pages like the following using tables: Create a Web Page like the following using forms:
  • 40. Exercises (2) Create a 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.* ##