SlideShare una empresa de Scribd logo
1 de 58
HTML 5 – Tables, Forms
                      and Frames
Doncho Minkov
Technical Trainer
http://minkov.it
Telerik Web Design Course
html5course.telerik.com
Contents
 HTML Tables

  Simple Tables
  Complete HTML 5 Tables
  Data cells and Header cells
 Nested Tables

 Complex tables

  Cells Width
  Cell Spacing and Padding
  Column and Row Span
                                            2
Contents (2)
 HTML Forms

  Form Fields and Fieldsets
  Text boxes
  Buttons
  Checkboxes and Radio Buttons
  Select fields
  Hidden fields
  Sliders and Spinboxes
  Validation fields
                                                 3
Contents (3)
 HTML Frames

  Frame and Noframe tags
  IFrames




                                           4
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
                                                  6
Simple HTML Tables – Example
<table cellspacing="0" cellpadding="5">
  <tr>
    <td><img src="ppt.gif"></td>
    <td><a href="lecture1.ppt">Lecture 1</a></td>
  </tr>
  <tr>
    <td><img src="ppt.gif"></td>
    <td><a href="lecture2.ppt">Lecture 2</a></td>
  </tr>
  <tr>
    <td><img src="zip.gif"></td>
    <td><a href="lecture2-demos.zip">
       Lecture 2 - Demos</a></td>
  </tr>
</table>
                                                    7
Simple HTML Tables
      Live Demo
Data Cells and Header Cells
 Two kinds of cells in HTML 5 tables

   Data cells – containing the table data
   Header cells – used for the column names or
    some more important cells in a table
 Why two kinds of cells?

   Used to semantically separate the cells
  <tr>
      <th>Full name</th> <th> Mark </th>
  </tr>
  <tr>
      <td>Doncho Minkov</td> <td>Very good 5</td>
  </tr>
  <tr>
      <td>Georgi Georgiev</td> <td>Exellent 6</td>
  </tr>
Data and Header Cells
       Live Demo
Complete
HTML 5 Tables
 With Header, Footer
      and Body
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)
                                                    12
Complete HTML Table: Example
<table>
   <colgroup>            columns
     <col style="width:100px" /><col />
   </colgroup>
                      header                  th
   <thead>
     <tr><th>Column 1</th><th>Column 2</th></tr>
   </thead>
   <tfoot>         footer
     <tr><td>Footer 1</td><td>Footer 2</td></tr>
   </tfoot>
   <tbody>                Last comes the body
                                 (data)
     <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>
                                                   13
Complete HTML Table:
                                Example (2)
<table>
                                       table-full.html
   <colgroup>
     <col style="width:200px" /><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>
                 Although the footer is
     <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr>
     <tr><td>Cellbefore the data in the
                  2.1</td><td>Cell 2.2</td></tr>
   </tbody>
                  code, it is displayed
</table>
                           last                          14
Complete HTML 5 Tables
        Live Demo
Nested Tables
Tables in Tables in Tables in Tables…
Nested Tables
   Table "cells" (<td>) can contain nested tables
    (tables within tables):
    <table>                          nested-tables.html
      <tr>
        <td>Contact:</td>
        <td>
           <table>
             <tr>
               <td>First Name</td>
               <td>Last Name</td>
             </tr>
           </table>
        </td>
      </tr>
    </table>
                                                          17
Nested Tables
   Live Demo
Complex Tables
With Padding, Spacing and Stuff
Cell Spacing and Padding
 Tables have two attributes related to space


  cellspacing            cellpadding


      cell     cell               cell    cell


      cell     cell               cell    cell


    Defines the            Defines the empty
     empty space             space around the cell
     between cells           content
                                                     20
Cell Spacing and Padding –
                                     Example
table-cells.html
<html>
  <head><title>Table Cells</title></head>
  <body>
    <table cellspacing="15" cellpadding="0">
       <tr><td>First</td>
       <td>Second</td></tr>
    </table>
    <br/>
    <table cellspacing="0" cellpadding="10">
       <tr><td>First</td><td>Second</td></tr>
    </table>
  </body>
</html>


                                                21
Cell Spacing and Padding –
                                  Example (2)
table-cells.html
<html>
  <head><title>Table Cells</title></head>
  <body>
    <table cellspacing="15" cellpadding="0">
       <tr><td>First</td>
       <td>Second</td></tr>
    </table>
    <br/>
    <table cellspacing="0" cellpadding="10">
       <tr><td>First</td><td>Second</td></tr>
    </table>
  </body>
</html>


                                                22
Table Cell Spacing
 and Cell Padding
      Live Demo
Row and Column
     Spans
 How to make a two-cells
    column? Or row?
Column and Row Span
 Cells have two attributes related to merging

    colspan                                 rowspan
     colspan="1     colspan="1         rowspan="2     rowspan="1
          "               "                 "               "
        cell[1,1]   cell[1,2]                          cell[1,2]
                                          cell[1,1]
              cell[2,1]                               cell[2,1]

                          colspan="2               rowspan="1
    Defines how               "           Defines how"

     many columns                             many rows the
     the cell occupies                        cell occupies
                                                                   25
Column and Row Span –
                                     Example
table-colspan-rowspan.html
<table cellspacing="0">
    <tr class="1"><td>Cell[1,1]</td>
         <td colspan="2">Cell[2,1]</td></tr>
    <tr class="2"><td>Cell[1,2]</td>
         <td rowspan="2">Cell[2,2]</td>
         <td>Cell[3,2]</td></tr>
    <tr class="3"><td>Cell[1,3]</td>
         <td>Cell[2,3]</td></tr>
</table>




                                               26
Column and Row Span –
table-colspan-rowspan.html
                                 Example (2)
<table cellspacing="0">
    <tr class="1"><td>Cell[1,1]</td>
         <td colspan="2">Cell[2,1]</td></tr>
    <tr class="2"><td>Cell[1,2]</td>
         <td rowspan="2">Cell[2,2]</td>
         <td>Cell[3,2]</td></tr>
    <tr class="3"><td>Cell[1,3]</td>
                Cell[1,1]
         <td>Cell[2,3]</td></tr>    Cell[2,1]
</table>
               Cell[1,2]                Cell[3,2]
                           Cell[2,2]
               Cell[1,3]                Cell[2,3]


                                                    27
Row and Columns
     Spans
    Live Demo
HTML 5 Forms
Entering User Data from a Web Page
What are HTML 5 Forms?
 The primary method for gathering data from

 site visitors
 HTML 5 Forms can contain

  Text fields for the user to type
  Buttons for interactions like "Register", "Login",
   "Search"
  Menus, Sliders, etc…
 Check Google, Yahoo, Facebook

  Google search field is a simple Text field
                                                        30
How to Create Forms?

 Create a form block with

  <form></form>        The "method" attribute tells
                       how the form data should be
 Example:            sent – via GET or POST request

  <form name="myForm" method="post" action="path/
  to/some-script.php">
     ...
  </form>
              The "action" attribute tells
             where the form data should be
                          sent
                                                       31
Text Fields
   Single-line text input fields:
     <input type="text" name="FirstName" value="This
     is a text field" />
   Multi-line text input fields (textarea):
     <textarea name="Comments">This is a multi-line
     text field</textarea>

   Password input – a text field which masks the
    entered text with * signs
     <input type="password" name="pass" />


                                                       32
Buttons
   Reset button – brings the form to its initial state
     <input type="reset" name="resetBtn"
     value="Reset the form" />
   Submit button:
    <input type="submit" value="Apply Now" />
   Image button – acts like submit but image is
    displayed and click coordinates are sent
     <input type="image" src="submit.gif"
     name="submitBtn" alt="Submit" />
   Ordinary button – no default action, used with JS
     <input type="button" value="click me" />
                                                          33
Checkboxes and Radio Buttons
   Checkboxes:

     <input type="checkbox" name="fruit"
     value="apple" />
   Radio buttons:

     <input type="radio" name="title" value="Mr." />
   Radio buttons can be grouped, allowing only one
    to be selected from a group:

     <input type="radio" name="city" value="Lom" />
     <input type="radio" name="city" value="Ruse" />

                                                       34
Select Fields
 Dropdown menus:

  <select name="gender">
    <option value="Value 1"
      selected="selected">Male</option>
    <option value="Value 2">Female</option>
    <option value="Value 3">Other</option>
  </select>
 Multiple-choice menus

  <select name="products" multiple="multiple">
    <option value="Value 1"
      selected="selected">keyboard</option>
    <option value="Value 2">mouse</option>
  </select>
                                                 35
Hidden Fields


   Hidden fields contain invisible data
     <input type="hidden" name="Account" value="This
     is a hidden text field" />
     Not shown to the user
     Used by JavaScript and server-side code
       ViewState, SessionState, etc..



                                                       36
Labels
   Labels are used to associate an explanatory text
    to a form field using the field's ID.
     <label for="fn">First Name</label>
     <input type="text" id="fn" />

   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.
                                                         37
Fieldsets
   Fieldsets are used to enclose a group of related
    form fields:
   <form method="post" action="form.aspx">
      <fieldset>
         <legend>Client Details</legend>
         <input type="text" id="Name" />
         <input type="text" id="Phone" />
      </fieldset>
      <fieldset>
         <legend>Order Details</legend>
         <input type="text" id="Quantity" />
         <textarea cols="40" rows="10"
            id="Remarks"></textarea>
      </fieldset>
 The <legend> is the fieldset's title.
   </form>
                                                       38
HTML 5 Forms
 Inputs Fields
    Live Demo
Sliders and Spinboxes
     Lets make it spin
Range and Spinbox
 Restricts users to enter only numbers

   Additional attributes min, max and step and
    value
   Can become Spinbox or Slider, depending on
    the input type
  <input type="range" min="0" max="100" />
  <input type="number" min="0" max="100" />
   Have some differences on different browsers
   Sliders and Spinboxes do not work on Firefox
    Shown as regular textboxes
                                                   41
Sliders and Spinboxes
       Live Demo
Attributes from HTML 5
   Autocomplete
     The browser stores the previously typed values
     Brings them back on a later visit on the same
      page
   Autofocus
     The field becomes on focus on page load
   Required
     The field is required to be filled/selected

                                                       43
Input Fields with Validation
 Email – provides a simple validation for email

   Can be passed a pattern for validation
   On a mobile device brings the email keyboard
 <input type="email" required="true"
 pattern="[^ @]*@[^ @].[^ @]"/>
 URL – has validation for url

   On a mobile device brings the url keyboard
 <input type="url" required="true" />
 Telephone

   Brings the numbers keyboard
 <input type="tel" required="true" />
                                                   44
HTML Forms Validation
       Live Demo




                        45
TabIndex
 The tabindex HTML attribute controls the

 order in which form fields and hyperlinks are
 focused when repeatedly pressing the TAB key
  tabindex="0" (zero) - "natural" order
  If X < Y, then elements with tabindex="X" are
   iterated before elements with tabindex="Y"
  Elements with negative tabindex are skipped,
   however, this is not defined in the standard

  <input type="text" tabindex="10" />

                                                   46
Tab Index
 Live Demo
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.            49
HTML Frames – Demo
                                           frames.html
<html>
    <head><title>Frames Example</title></head>
    <frameset cols="180px,*,150px">
      <frame src="left.html" />
      <frame src="middle.html" />
      <frame src="right.html" />
    </frameset>
</html>


   Note the target attribute applied to the
    <a> elements in the left frame.
                                                         50
Inline Frames: <iframe>
 Inline frames provide a way to show one

 website inside another website:

                                       iframe-demo.html
  <iframe name="iframeGoogle"   width="600" height="400"
  src="http://www.google.com"   frameborder="yes"
  scrolling="yes"></iframe>




                                                           51
HTML 5 Tables and Forms




          http://html5course.telerik.com
Homework
1.   Create Web Pages like the following using
     tables:




1.   Create a Web Page
     like the following
     using forms:

                                                 53
Homework (2)
1.   Create a Web form
     that looks like this
     sample:




                                       54
Homework (3)
1.    Create a Calculator-like table.
      You should use a HTML 5
      form for the Calculator
      Buttons for all the numbers
       and operators (+, -, etc.)
      Textbox for the result
      Do not make the same styles
       as the example.




                                                   55
Homework (4)
1.   Create the following using tables and forms:




                                                    56
Homework (5)
1.    Construct the following Grid component:




      Try to make a HTML page, that looks just like the
       example
      Not required to style for the homework
                                                           57
Homework (7)
1.    Create the following HTML 5 Page
      Hint: Use Fieldsets and Nested tables




                                                   58

Más contenido relacionado

La actualidad más candente (20)

Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Html
HtmlHtml
Html
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Html frames
Html framesHtml frames
Html frames
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Html notes
Html notesHtml notes
Html notes
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Html,javascript & css
Html,javascript & cssHtml,javascript & css
Html,javascript & css
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
What is css
What is cssWhat is css
What is css
 
Html and css
Html and cssHtml and css
Html and css
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
Pagemaker
PagemakerPagemaker
Pagemaker
 
Html forms
Html formsHtml forms
Html forms
 
Html forms
Html formsHtml forms
Html forms
 

Similar a HTML 5 Tables and Forms

Html - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik AcademyHtml - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik AcademyOgnyan Penkov
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)club23
 
Table structure introduction
Table structure introductionTable structure introduction
Table structure introductionnobel mujuji
 
v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxHemantBansal35
 
Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTMLMustafa Kamel Mohammadi
 
Tables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxTables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxSALT13
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in htmlCK Yang
 
Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3Mudasir Syed
 

Similar a HTML 5 Tables and Forms (20)

01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx01 HTML-Tables-1.pptx
01 HTML-Tables-1.pptx
 
Handout5 tables
Handout5 tablesHandout5 tables
Handout5 tables
 
HTML Tables
HTML TablesHTML Tables
HTML Tables
 
Web I - 03 - Tables
Web I - 03 - TablesWeb I - 03 - Tables
Web I - 03 - Tables
 
Html - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik AcademyHtml - Tables, Forms and Frames by Telerik Academy
Html - Tables, Forms and Frames by Telerik Academy
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
 
html-table
html-tablehtml-table
html-table
 
Html tables
Html tablesHtml tables
Html tables
 
HTML Tables.ppt
HTML Tables.pptHTML Tables.ppt
HTML Tables.ppt
 
Table structure introduction
Table structure introductionTable structure introduction
Table structure introduction
 
v4-html-table-210321161424.pptx
v4-html-table-210321161424.pptxv4-html-table-210321161424.pptx
v4-html-table-210321161424.pptx
 
Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTML
 
Tables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxTables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptx
 
Lecture-4.pptx
Lecture-4.pptxLecture-4.pptx
Lecture-4.pptx
 
Table and Form HTML&CSS
Table and Form HTML&CSSTable and Form HTML&CSS
Table and Form HTML&CSS
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
 
Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3
 
Html
HtmlHtml
Html
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
 
Lect# 1 html part ii
Lect# 1 html part iiLect# 1 html part ii
Lect# 1 html part ii
 

Más de Doncho Minkov

Más de Doncho Minkov (20)

Web Design Concepts
Web Design ConceptsWeb Design Concepts
Web Design Concepts
 
Web design Tools
Web design ToolsWeb design Tools
Web design Tools
 
HTML 5
HTML 5HTML 5
HTML 5
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
CSS Presentation
CSS PresentationCSS Presentation
CSS Presentation
 
CSS Layout
CSS LayoutCSS Layout
CSS Layout
 
CSS 3
CSS 3CSS 3
CSS 3
 
Adobe Photoshop
Adobe PhotoshopAdobe Photoshop
Adobe Photoshop
 
Slice and Dice
Slice and DiceSlice and Dice
Slice and Dice
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
WPF Layout Containers
WPF Layout ContainersWPF Layout Containers
WPF Layout Containers
 
WPF Controls
WPF ControlsWPF Controls
WPF Controls
 
WPF Templating and Styling
WPF Templating and StylingWPF Templating and Styling
WPF Templating and Styling
 
WPF Graphics and Animations
WPF Graphics and AnimationsWPF Graphics and Animations
WPF Graphics and Animations
 
Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
Complex Data Binding
Complex Data BindingComplex Data Binding
Complex Data Binding
 
WPF Concepts
WPF ConceptsWPF Concepts
WPF Concepts
 
Model View ViewModel
Model View ViewModelModel View ViewModel
Model View ViewModel
 
WPF and Databases
WPF and DatabasesWPF and Databases
WPF and Databases
 
Introduction to Cross-platform Mobile Development Course
Introduction to Cross-platform Mobile Development CourseIntroduction to Cross-platform Mobile Development Course
Introduction to Cross-platform Mobile Development Course
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

HTML 5 Tables and Forms

  • 1. HTML 5 – Tables, Forms and Frames Doncho Minkov Technical Trainer http://minkov.it Telerik Web Design Course html5course.telerik.com
  • 2. Contents  HTML Tables  Simple Tables  Complete HTML 5 Tables  Data cells and Header cells  Nested Tables  Complex tables  Cells Width  Cell Spacing and Padding  Column and Row Span 2
  • 3. Contents (2)  HTML Forms  Form Fields and Fieldsets  Text boxes  Buttons  Checkboxes and Radio Buttons  Select fields  Hidden fields  Sliders and Spinboxes  Validation fields 3
  • 4. Contents (3)  HTML Frames  Frame and Noframe tags  IFrames 4
  • 6. 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
  • 7. Simple HTML Tables – Example <table cellspacing="0" cellpadding="5"> <tr> <td><img src="ppt.gif"></td> <td><a href="lecture1.ppt">Lecture 1</a></td> </tr> <tr> <td><img src="ppt.gif"></td> <td><a href="lecture2.ppt">Lecture 2</a></td> </tr> <tr> <td><img src="zip.gif"></td> <td><a href="lecture2-demos.zip"> Lecture 2 - Demos</a></td> </tr> </table> 7
  • 8. Simple HTML Tables Live Demo
  • 9. Data Cells and Header Cells  Two kinds of cells in HTML 5 tables  Data cells – containing the table data  Header cells – used for the column names or some more important cells in a table  Why two kinds of cells?  Used to semantically separate the cells <tr> <th>Full name</th> <th> Mark </th> </tr> <tr> <td>Doncho Minkov</td> <td>Very good 5</td> </tr> <tr> <td>Georgi Georgiev</td> <td>Exellent 6</td> </tr>
  • 10. Data and Header Cells Live Demo
  • 11. Complete HTML 5 Tables With Header, Footer and Body
  • 12. 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) 12
  • 13. Complete HTML Table: Example <table> <colgroup> columns <col style="width:100px" /><col /> </colgroup> header th <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead> <tfoot> footer <tr><td>Footer 1</td><td>Footer 2</td></tr> </tfoot> <tbody> Last comes the body (data) <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> 13
  • 14. Complete HTML Table: Example (2) <table> table-full.html <colgroup> <col style="width:200px" /><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> Although the footer is <tr><td>Cell 1.1</td><td>Cell 1.2</td></tr> <tr><td>Cellbefore the data in the 2.1</td><td>Cell 2.2</td></tr> </tbody> code, it is displayed </table> last 14
  • 15. Complete HTML 5 Tables Live Demo
  • 16. Nested Tables Tables in Tables in Tables in Tables…
  • 17. Nested Tables  Table "cells" (<td>) can contain nested tables (tables within tables): <table> nested-tables.html <tr> <td>Contact:</td> <td> <table> <tr> <td>First Name</td> <td>Last Name</td> </tr> </table> </td> </tr> </table> 17
  • 18. Nested Tables Live Demo
  • 19. Complex Tables With Padding, Spacing and Stuff
  • 20. Cell Spacing and Padding  Tables have two attributes related to space  cellspacing  cellpadding cell cell cell cell cell cell cell cell  Defines the  Defines the empty empty space space around the cell between cells content 20
  • 21. Cell Spacing and Padding – Example table-cells.html <html> <head><title>Table Cells</title></head> <body> <table cellspacing="15" cellpadding="0"> <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing="0" cellpadding="10"> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> 21
  • 22. Cell Spacing and Padding – Example (2) table-cells.html <html> <head><title>Table Cells</title></head> <body> <table cellspacing="15" cellpadding="0"> <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing="0" cellpadding="10"> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> 22
  • 23. Table Cell Spacing and Cell Padding Live Demo
  • 24. Row and Column Spans How to make a two-cells column? Or row?
  • 25. Column and Row Span  Cells have two attributes related to merging  colspan  rowspan colspan="1 colspan="1 rowspan="2 rowspan="1 " " " " cell[1,1] cell[1,2] cell[1,2] cell[1,1] cell[2,1] cell[2,1] colspan="2 rowspan="1  Defines how "  Defines how" many columns many rows the the cell occupies cell occupies 25
  • 26. Column and Row Span – Example table-colspan-rowspan.html <table cellspacing="0"> <tr class="1"><td>Cell[1,1]</td> <td colspan="2">Cell[2,1]</td></tr> <tr class="2"><td>Cell[1,2]</td> <td rowspan="2">Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr class="3"><td>Cell[1,3]</td> <td>Cell[2,3]</td></tr> </table> 26
  • 27. Column and Row Span – table-colspan-rowspan.html Example (2) <table cellspacing="0"> <tr class="1"><td>Cell[1,1]</td> <td colspan="2">Cell[2,1]</td></tr> <tr class="2"><td>Cell[1,2]</td> <td rowspan="2">Cell[2,2]</td> <td>Cell[3,2]</td></tr> <tr class="3"><td>Cell[1,3]</td> Cell[1,1] <td>Cell[2,3]</td></tr> Cell[2,1] </table> Cell[1,2] Cell[3,2] Cell[2,2] Cell[1,3] Cell[2,3] 27
  • 28. Row and Columns Spans Live Demo
  • 29. HTML 5 Forms Entering User Data from a Web Page
  • 30. What are HTML 5 Forms?  The primary method for gathering data from site visitors  HTML 5 Forms can contain  Text fields for the user to type  Buttons for interactions like "Register", "Login", "Search"  Menus, Sliders, etc…  Check Google, Yahoo, Facebook  Google search field is a simple Text field 30
  • 31. How to Create Forms?  Create a form block with <form></form> The "method" attribute tells how the form data should be  Example: sent – via GET or POST request <form name="myForm" method="post" action="path/ to/some-script.php"> ... </form> The "action" attribute tells where the form data should be sent 31
  • 32. Text Fields  Single-line text input fields: <input type="text" name="FirstName" value="This is a text field" />  Multi-line text input fields (textarea): <textarea name="Comments">This is a multi-line text field</textarea>  Password input – a text field which masks the entered text with * signs <input type="password" name="pass" /> 32
  • 33. Buttons  Reset button – brings the form to its initial state <input type="reset" name="resetBtn" value="Reset the form" />  Submit button: <input type="submit" value="Apply Now" />  Image button – acts like submit but image is displayed and click coordinates are sent <input type="image" src="submit.gif" name="submitBtn" alt="Submit" />  Ordinary button – no default action, used with JS <input type="button" value="click me" /> 33
  • 34. Checkboxes and Radio Buttons  Checkboxes: <input type="checkbox" name="fruit" value="apple" />  Radio buttons: <input type="radio" name="title" value="Mr." />  Radio buttons can be grouped, allowing only one to be selected from a group: <input type="radio" name="city" value="Lom" /> <input type="radio" name="city" value="Ruse" /> 34
  • 35. Select Fields  Dropdown menus: <select name="gender"> <option value="Value 1" selected="selected">Male</option> <option value="Value 2">Female</option> <option value="Value 3">Other</option> </select>  Multiple-choice menus <select name="products" multiple="multiple"> <option value="Value 1" selected="selected">keyboard</option> <option value="Value 2">mouse</option> </select> 35
  • 36. Hidden Fields  Hidden fields contain invisible data <input type="hidden" name="Account" value="This is a hidden text field" />  Not shown to the user  Used by JavaScript and server-side code  ViewState, SessionState, etc.. 36
  • 37. Labels  Labels are used to associate an explanatory text to a form field using the field's ID. <label for="fn">First Name</label> <input type="text" id="fn" />  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. 37
  • 38. Fieldsets  Fieldsets are used to enclose a group of related form fields: <form method="post" action="form.aspx"> <fieldset> <legend>Client Details</legend> <input type="text" id="Name" /> <input type="text" id="Phone" /> </fieldset> <fieldset> <legend>Order Details</legend> <input type="text" id="Quantity" /> <textarea cols="40" rows="10" id="Remarks"></textarea> </fieldset>  The <legend> is the fieldset's title. </form> 38
  • 39. HTML 5 Forms Inputs Fields Live Demo
  • 40. Sliders and Spinboxes Lets make it spin
  • 41. Range and Spinbox  Restricts users to enter only numbers  Additional attributes min, max and step and value  Can become Spinbox or Slider, depending on the input type <input type="range" min="0" max="100" /> <input type="number" min="0" max="100" />  Have some differences on different browsers  Sliders and Spinboxes do not work on Firefox  Shown as regular textboxes 41
  • 43. Attributes from HTML 5  Autocomplete  The browser stores the previously typed values  Brings them back on a later visit on the same page  Autofocus  The field becomes on focus on page load  Required  The field is required to be filled/selected 43
  • 44. Input Fields with Validation  Email – provides a simple validation for email  Can be passed a pattern for validation  On a mobile device brings the email keyboard <input type="email" required="true" pattern="[^ @]*@[^ @].[^ @]"/>  URL – has validation for url  On a mobile device brings the url keyboard <input type="url" required="true" />  Telephone  Brings the numbers keyboard <input type="tel" required="true" /> 44
  • 45. HTML Forms Validation Live Demo 45
  • 46. TabIndex  The tabindex HTML attribute controls the order in which form fields and hyperlinks are focused when repeatedly pressing the TAB key  tabindex="0" (zero) - "natural" order  If X < Y, then elements with tabindex="X" are iterated before elements with tabindex="Y"  Elements with negative tabindex are skipped, however, this is not defined in the standard <input type="text" tabindex="10" /> 46
  • 49. 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. 49
  • 50. HTML Frames – Demo frames.html <html> <head><title>Frames Example</title></head> <frameset cols="180px,*,150px"> <frame src="left.html" /> <frame src="middle.html" /> <frame src="right.html" /> </frameset> </html>  Note the target attribute applied to the <a> elements in the left frame. 50
  • 51. Inline Frames: <iframe>  Inline frames provide a way to show one website inside another website: iframe-demo.html <iframe name="iframeGoogle" width="600" height="400" src="http://www.google.com" frameborder="yes" scrolling="yes"></iframe> 51
  • 52. HTML 5 Tables and Forms http://html5course.telerik.com
  • 53. Homework 1. Create Web Pages like the following using tables: 1. Create a Web Page like the following using forms: 53
  • 54. Homework (2) 1. Create a Web form that looks like this sample: 54
  • 55. Homework (3) 1. Create a Calculator-like table. You should use a HTML 5 form for the Calculator  Buttons for all the numbers and operators (+, -, etc.)  Textbox for the result  Do not make the same styles as the example. 55
  • 56. Homework (4) 1. Create the following using tables and forms: 56
  • 57. Homework (5) 1. Construct the following Grid component:  Try to make a HTML page, that looks just like the example  Not required to style for the homework 57
  • 58. Homework (7) 1. Create the following HTML 5 Page  Hint: Use Fieldsets and Nested tables 58

Notas del editor

  1. * 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.* ##
  2. * 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.* ##
  3. * 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.* ##
  4. * 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.* ##
  5. * 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.* ##
  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.* ##
  7. * 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.* ##
  9. * 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.* ##
  10. * 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.* ##
  11. * 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.* ##