Presentation is loading. Please wait.

Presentation is loading. Please wait.

Svetlin Nakov Telerik Corporation www.telerik.com.

Similar presentations


Presentation on theme: "Svetlin Nakov Telerik Corporation www.telerik.com."— Presentation transcript:

1 Svetlin Nakov Telerik Corporation

2 1. HTML Tables Nested Tables Nested Tables Cells Width Cells Width Cell Spacing and Padding Cell Spacing and Padding Column and Row Span Column and Row Span 2

3 2. HTML Forms Form Fields and Fieldsets Form Fields and Fieldsets Form Controls and Labels Form Controls and Labels Text field Text field Text area Text area Select Select Radio button Radio button Checkbox Checkbox Button Button Image button Image button 3

4

5 Tables represent tabular data Tables represent tabular data A table consists of one or several rows A table consists of one or several rows Each row has one or more columns Each row has one or more columns Tables comprised of several core tags: : begin / end the table : create a table row : create tabular data (cell) Tables comprised of several core tags: : begin / end the table : create a table row : create tabular data (cell) Tables should not be used for layout. Use CSS floats and positioning styles instead Tables should not be used for layout. Use CSS floats and positioning styles instead 5

6 Start and end of a table Start and end of a table Start and end of a row Start and end of a row Start and end of a cell in a row Start and end of a cell in a row

7 7 Lecture 1 Lecture 1 Lecture 2 Lecture 2 Lecture 2 - Demos Lecture 2 - Demos

8 Lecture 1 Lecture 1 Lecture 2 Lecture 2 Lecture 2 - Demos Lecture 2 - Demos 8

9 Live Demo

10 Table rows split into three semantic sections: header, body and footer Table rows split into three semantic sections: header, body and footer denotes table header and contains elements, instead of elements denotes table header and contains elements, instead of elements denotes collection of table rows that contain the very data denotes collection of table rows that contain the very data denotes table footer but comes BEFORE the tag denotes table footer but comes BEFORE the tag and define columns (most often used to set column widths) and define columns (most often used to set column widths) 10

11 11

Column 1 Column 2 Column 1 Column 2 Footer 1 Footer 2 Footer 1 Footer 2 Cell 1.1 Cell 1.2 Cell 1.1 Cell 1.2 Cell 2.1 Cell 2.2 Cell 2.1 Cell 2.2
header footer Last comes the body (data) th columns

12

Column 1 Column 2 Column 1 Column 2 Footer 1 Footer 2 Footer 1 Footer 2 Cell 1.1 Cell 1.2 Cell 1.1 Cell 1.2 Cell 2.1 Cell 2.2 Cell 2.1 Cell 2.2
12 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.

13 Table data cells ( ) can contain nested tables (tables within tables): Table data cells ( ) can contain nested tables (tables within tables): 13

Contact: Contact: First Name First Name Last Name Last Name
nested-tables.html

14 Live Demo

15 cellpadding cellpadding Defines the empty space around the cell content Defines the empty space around the cell content cellspacing cellspacing Defines the empty space between cells Defines the empty space between cells Tables have two important attributes: Tables have two important attributes: 15 cellcell cellcell cell cell cell cell

16 16 Table Cells Table Cells First First Second Second First Second First Second table-cells.html

17 17 Table Cells Table Cells First First Second Second First Second First Second table-cells.html

18 Live Demo

19 rowspan rowspan Defines how many rows the cell occupies Defines how many rows the cell occupies colspan colspan Defines how many columns the cell occupies Defines how many columns the cell occupies Table cells have two important attributes: Table cells have two important attributes: 19 cell[1,1]cell[1,2] cell[2,1] colspan="1"colspan="1" colspan="2" cell[1,1]cell[1,2] cell[2,1] rowspan="2"rowspan="1" rowspan="1"

20 20 Cell[1,1] Cell[1,1] Cell[2,1] Cell[2,1] Cell[1,2] Cell[1,2] Cell[2,2] Cell[2,2] Cell[3,2] Cell[3,2] Cell[1,3] Cell[1,3] Cell[2,3] Cell[2,3] table-colspan-rowspan.html

21 Cell[1,1] Cell[1,1] Cell[2,1] Cell[2,1] Cell[1,2] Cell[1,2] Cell[2,2] Cell[2,2] Cell[3,2] Cell[3,2] Cell[1,3] Cell[1,3] Cell[2,3] Cell[2,3] 21 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]

22 Entering User Data from a Web Page

23 Forms are the primary method for gathering data from site visitors Forms are the primary method for gathering data from site visitors Create a form block with Create a form block with Example: Example: 23

...... The "action" attribute tells where the form data should be sent The method" attribute tells how the form data should be sent – via GET or POST request

24 Single-line text input fields: Single-line text input fields: Multi-line textarea fields: Multi-line textarea fields: Hidden fields contain data not shown to the user: Hidden fields contain data not shown to the user: Often used by JavaScript code Often used by JavaScript code 24 This is a multi-line text field This is a multi-line text field

25 Fieldsets are used to enclose a group of related form fields: Fieldsets are used to enclose a group of related form fields: The is the fieldset's title. The is the fieldset's title. 25 Client Details Client Details Order Details Order Details

26 Checkboxes: Checkboxes: Radio buttons: Radio buttons: Radio buttons can be grouped, allowing only one to be selected from a group: Radio buttons can be grouped, allowing only one to be selected from a group: 26

27 Dropdown menus: Dropdown menus: Submit button: Submit button: 27

28 Reset button – brings the form to its initial state Reset button – brings the form to its initial state Image button – acts like submit but image is displayed and click coordinates are sent Image button – acts like submit but image is displayed and click coordinates are sent Ordinary button – used for Javascript, no default action Ordinary button – used for Javascript, no default action 28

29 Password input – a text field which masks the entered text with * signs 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 Multiple select field – displays the list of items in multiple lines, instead of one 29

30 File input – a field used for uploading files File input – a field used for uploading files When used, it requires the form element to have a specific attribute: When used, it requires the form element to have a specific attribute:

31 Form labels are used to associate an explanatory text to a form field using the field's ID. 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) 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. Labels are both a usability and accessibility feature and are required in order to pass accessibility validation. 31 First Name First Name

32 32 Academic information Academic information Degree Degree Bachelor of Art Bachelor of Art Bachelor of Science Bachelor of Science Master of Master of Business Administration Business Administration Student ID Student ID Personal Details Personal Details First Name First Name Last Name Last Name form.html

33 33 Gender: Gender: Male Male Female Female