Tables, Rows, Columns, Cells, Header, Footer, Colspan, Rowspan

Slides:



Advertisements
Similar presentations
Svetlin Nakov Telerik Corporation
Advertisements

Svetlin Nakov Telerik Corporation
Doncho Minkov Technical Trainer Telerik School Academy.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
Svetlin Nakov Telerik Corporation
JavaScript Basics Course Introduction SoftUni Team Technical Trainers Software University
 Dimitar Ivanov Introduction to programming with microcontrollers.
AngularJS Routing Routes, Route Parameters, Templates, Location, Navigation SoftUni Team Technical Trainers Software University
AngularJS Services Built-in and Custom Services SoftUni Team Technical Trainers Software University
Methods Writing and using methods, overloads, ref, out SoftUni Team Technical Trainers Software University
Software University Curriculum, Courses, Exams, Jobs SoftUni Team Technical Trainers Software University
Fundamentals SoftUni Welcome to Software University SoftUni Team Technical Trainers Software University
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC SoftUni Team Technical Trainers Software University
AngularJS Directives Defining Custom Directives SoftUni Team Technical Trainers Software University
Software Testing Lifecycle Exit Criteria Evaluation, Continuous Integration Ivan Yonkov Technical Trainer Software University.
Teamwork and Personal Skills Course Introduction Software University SoftUni Team Technical Trainers.
Fundamentals SoftUni Welcome to Software University SoftUni Team Technical Trainers Software University
High-Quality Programming Code Code Correctness, Readability, Maintainability, Testability, Etc. SoftUni Team Technical Trainers Software University
JavaScript Design Patterns Private Fields, Module, Revealing Module, Revealing Prototype, … Software University Technical Trainers SoftUni.
NoSQL Databases NoSQL Concepts SoftUni Team Technical Trainers Software University
Loops Repeating Code Multiple Times SoftUni Team Technical Trainers Software University
Start Your Own Blog Angel Georgiev Part-time Trainer angeru.softuni-friends.org Software University The Culture of Knowledge Sharing.
Database APIs and Wrappers
Entity Framework Performance SoftUni Team Technical Trainers Software University
Svetlin Nakov Technical Trainer Software University
Build Processes and Continuous Integration Automating Build Processes Software University Technical Trainers SoftUni Team.
Processing Redis with.NET How to Operate with Redis Databases SoftUni Team Technical Trainers Software University
Multidimensional Arrays, Sets, Dictionaries Processing Matrices, Multidimensional Arrays, Dictionaries, Sets SoftUni Team Technical Trainers Software University.
Svetlin Nakov Telerik Corporation
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC Angel Georgiev Part-time Trainer Software University
Test-Driven Development Learn the "Test First" Approach to Coding SoftUni Team Technical Trainers Software University
JavaScript Basics Course Introduction Svetlin Nakov Technical Trainer Software University
CSS Layout Arrangement and Positioning of the HTML Elements Svetlin Nakov Technical Trainer Software University
CV Structure, Content, Layout, Formatting, Best Practices SoftUni Team Technical Trainers Software University
Controllers and Markup Controllers, $scope, Markup, Directives, Expressions, Binding, Filters, Validation SoftUni Team Technical Trainers Software University.
AMD and RequireJS Splitting JavaScript Code into Dependent Modules Software University Technical Trainers SoftUni Team.
Asynchronous Web Services Writing Asynchronous Web Services SoftUni Team Technical Trainers Software University
SASS & LESS Syntactically Awesome StyleSheets Dynamic StyleSheet Language Svetlin Nakov Technical Trainer Software University
Web Fundamentals (HTML and CSS) Course Introduction SoftUni Team Technical Trainers Software University
HTML – Other Tags Semantic Tags, Frames, Embed Multimedia Content, Others SoftUni Team Technical Trainers Software University
HTML – Other Tags Semantic Tags, Frames, Embed Multimedia Content, Others SoftUni Team Technical Trainers Software University
Jekyll Static Site Generator Template-Based Site Generation Svetlin Nakov Technical Trainer Software University
Web Fundamentals (HTML and CSS) Course Introduction Svetlin Nakov Technical Trainer Software University
Forms Overview, Query string, Submitting arrays, PHP & HTML, Input types, Redirecting the user Mario Peshev Technical Trainer Software.
JavaScript Modules and Patterns Private Fields, Module, Revealing Module, Revealing Prototype, … Software University Technical Trainers.
Web Development Tools Tools for Front-End Developers Writing HTML and CSS Code SoftUni Team Technical Trainers Software University
HTML 5 Overview Document Structure, Basic Tags, Common Elements SoftUni Team Technical Trainers Software University
Web Fundamentals (HTML and CSS)
Responsive Design Design that Adapts to Different Devices SoftUni Team Technical Trainers Software University
Exam Preparation Algorithms Course: Sample Exam SoftUni Team Technical Trainers Software University
CSS Transitions and Animations Animated HTML Elements SoftUni Team Technical Trainers Software University
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
Bootstrap Front-End Framework for Responsive Web Sites Svetlin Nakov Technical Trainer Software University
Events Event Handling in JavaScript SoftUni Team Technical Trainers Software University
Mocking with Moq Tools for Easier Unit Testing SoftUni Team Technical Trainers Software University
Mocking with Moq Mocking tools for easier unit testing Svetlin Nakov Technical Trainer Software University
JavaScript Tools Tools for Writing / Editing / Debugging JavaScript Code Svetlin Nakov Technical Trainer Software University
Test-Driven Development Learn the "Test First" Approach to Coding Svetlin Nakov Technical Trainer Software University
Sets, Dictionaries SoftUni Team Technical Trainers Software University
Creating Content Defining Topic, Creating Technical Training Materials SoftUni Team Technical Trainers Software University
Doctrine The PHP ORM SoftUni Team Technical Trainers Software University
Team Work and Personal Skills Course Introduction Angel Georgiev Part-time Trainer Software University
Creating Content Defining Topic, Creating Technical Training Materials SoftUni Team Technical Trainers Software University
First Steps in PHP Creating Very Simple PHP Scripts SoftUni Team Technical Trainers Software University
Inheritance Class Hierarchies SoftUni Team Technical Trainers Software University
Stacks and Queues Processing Sequences of Elements SoftUni Team Technical Trainers Software University
Generics SoftUni Team Technical Trainers Software University
Extending functionality using Collections
CSS Transitions and Animations
CSS Transitions and Animations
Presentation transcript:

Tables, Rows, Columns, Cells, Header, Footer, Colspan, Rowspan HTML Tables Tables, Rows, Columns, Cells, Header, Footer, Colspan, Rowspan SoftUni Team Technical Trainers Software University http://softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Table of Contents HTML Tables Nested Tables Complex Tables Simple Tables Complete HTML Tables Data, Header and Footer Cells Nested Tables Complex Tables Cells Width Cell Spacing and Padding Column and Row Span

HTML Tables

HTML Tables Tables represent tabular data * HTML Tables 07/16/96 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 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Simple HTML Tables – Example <table cellspacing="0" cellpadding="5"> <tr> <td><img src="ppt.gif"></td> <td><a href="lesson1.ppt">Lesson 1</a></td> </tr> <td><a href="lesson2.ppt">Lesson 2</a></td> <td><img src="zip.gif"></td> <td><a href="lesson2-demos.zip">Lesson 2 - Demos</a></td> </table>

Simple HTML Tables Live Demo * 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.*

Data Cells and Header Cells Two kinds of cells in HTML tables Data cells Hold the table data – <td> Header cells Hold the column names – <th> Semantically separate data and headers <tr> <th>Full Name</th> <th>Grade</th> </tr> <tr> <td>Mariela Anderson</td> <td>Very Good (5)</td> </tr> <tr> <td>Georgi Georgiev</td> <td>Exellent (6)</td> </tr>

Data and Header Cells Live Demo

With Header, Footer and Body Complete HTML Tables With Header, Footer and Body

Complete HTML Tables Table rows split into several semantic sections: <thead> denotes the table header Contains <th> elements, instead of <td> cells <tbody> denotes collection of table rows holding table data <tfoot> denotes table footer It may comes before the <tbody> elements, but is displayed last <colgroup> and <col> define columns Used to assign column widths

Complete HTML Table: Example <colgroup> <col style="width:100px" /><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> column width definitions table header <th>  header column footer Last comes the body (data)

Complete HTML Table: Example (2) Deprecated: use CSS instead! <table> <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> <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> Although the footer is before the data in the code, it is displayed last

Complete HTML Tables Live Demo

Tables in Tables in Tables in Tables… Nested Tables Tables in Tables in Tables in Tables…

* Nested Tables 07/16/96 Table "cells" (<td>) can contain nested tables (tables within tables): <table> <tr> <td>Contact:</td> <td> <td>First Name</td> <td>Last Name</td> </tr> </table> </td> (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Nested Tables Live Demo * 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.*

With Padding, Spacing, Etc. Complex Tables With Padding, Spacing, Etc.

Cell Spacing and Padding * Cell Spacing and Padding 07/16/96 Tables have two attributes related to space cellspacing Defines the empty space between cells cellpadding Defines the empty space around the cell content cell cell (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Cell Spacing and Padding – Example * Cell Spacing and Padding – Example 07/16/96 <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> </body> </html> Deprecated: use CSS instead! (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Cell Spacing and Cell Padding * 07/16/96 Cell Spacing and Cell Padding Live Demo (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to Make a Two-Cells Column or Row? Row and Column Spans How to Make a Two-Cells Column or Row?

Column and Row Span Cells have two attributes related to merging * Column and Row Span 07/16/96 Cells have two attributes related to merging colspan Defines how many columns the cell occupies rowspan Defines how many rows the cell occupies colspan="1" colspan="1" rowspan="2" rowspan="1" cell[1,1] cell[1,2] cell[1,1] cell[1,2] cell[2,1] cell[2,1] colspan="2" rowspan="1" (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Column and Row Span – Example * Column and Row Span – Example 07/16/96 <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 class="3"> <td>Cell[1,3]</td> <td>Cell[2,3]</td> </table> (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Row and Column Spans Live Demo

Summary HTML tables Styling tables: Defined by <table>, <tr>, <td> tags Semantic tags: <thead>, <tbody>, <tfoot> Columns: <colgroup>, <col>, <th> Column / row span: colspan, rowspan Styling tables: Prefer CSS Old tags: cellspacing, cellpadding, border © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

HTML Tables https://softuni.bg/courses/web-fundamentals/ © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

License This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" license Attribution: this work may contain portions from "HTML Basics" course by Telerik Academy under CC-BY-NC-SA license "CSS Styling" course by Telerik Academy under CC-BY-NC-SA license © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Free Trainings @ Software University Software University Foundation – softuni.org Software University – High-Quality Education, Profession and Job for Software Developers softuni.bg Software University @ Facebook facebook.com/SoftwareUniversity Software University @ YouTube youtube.com/SoftwareUniversity Software University Forums – forum.softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.