Muhammad Meer Hazaar (Software Engineer)

Slides:



Advertisements
Similar presentations
HTML TABLES EXPLAINED. What is a TABLE? The HTML table allows web designers to arrange & organize data -- text, images, hyperlinks, forms, form fields,
Advertisements

Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 6: HTML Tables.
HTML. Creating a Table Attributes: border: indicates the border type of the table Value: 0 (no border), 1, 2, etc. cols: indicates the number of columns.
What is a TABLE? The HTML table allows web designers to arrange & organize data -- text, images, hyperlinks, forms, form fields, other tables, etc. Tables.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
Tutorial #8 – Creating Data Tables. Tutorial #6 Review – Layouts Two Column Fixed Width, Three Column Fixed Width Class VS. ID Container Universal Selector.
Identifies the Structure Table Row Column 1 Table Heading Column 2.
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
Bayu Priyambadha, S.Kom. for long documents, you can even have links to other locations in that same document  … where ident is a variable for identifying.
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
HTML B OOT C AMP Chapter 10 Tables Kirkwood Continuing Education © Copyright 2015, Fred McClurg All Rights Reserved.
CSS Table Properties.
Html Tables Basic Table Markup. How Tables are Used For Data Display Tables were originally designed to display and organize tabular data (charts, statistics,
Introducing Web Tables. Tables for tabulating items  Better looking  More flexibility  More efficient to explain information than plain text.
TABLES 1. In this chapter you will learn that tables have many uses in HTML. Objectives: Upon completing this section, you should be able to: 1. Insert.
ECA 228 Internet/Intranet Design I Tables. ECA 228 Internet/Intranet Design I Basic HTML Tables Created as a way to present rows and clumns of data.
1 Tables attributes. 2 Table attributes: border Activates border around cells Syntax: – where “n” is a value in pixels which controls the “thickness”
CIS234A Lecture 8 Instructor Greg D’Andrea. Review Text Table contains only text, evenly spaced on the Web page in rows and columns uses only standard.
26 HTML Tables … surround table … surround each row … surround each cell … like, but bold and centered by default (for table headings) … table title No.
How To Create HTML Tables. Table Structure General HTML code for a Web Table: table cells table cells.
REEM ALMOTIRI Information Technology Department Majmaah University.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Block-Level Elements.
Tables creating a table within a web page. What makes up a table? Columns Rows.
Session: 9. © Aptech Ltd. 2Creating Tables / Session 9  Describe how to create and format tables  Explain the table size and the width of a column 
1 Mansoor Ahmed Bughio. 2 HTML TABLES With HTML you can create tables. Examples Tables This example demonstrates how to create tables in an HTML document.
Introduction and HTML overview
Web page Designing using HTML
Client-Side Internet and Web Programming
CSE 154 Lecture 17: HTML tables.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Web Development & Design Foundations with HTML5
Internet & Web Engineering Course Code:CS-228 Credit Hours (3+1) Lab 2 HTML TABLES Instructor: Muhammad Zeeshan Haider Ali Blog Address:
HyperText Markup Language
>> HTML: Tables.
Lists, Images, Tables and Links
Web Development & Design Foundations with HTML5 8th Edition
Lists-Tables-Frames Unit - I.
HTML Tables CS 1150 Spring 2017.
HTML Tables.
Tutorial 5 Working with Tables and Columns
Web Development Part 3.
Introduction to HTML.
Client-Side Internet and Web Programming
How to work with tables Chapter 10.
Chapter 7 Tables.
H T M L A B E S X P I N D.
The Internet 10/25/11 XHTML Tables
TABLES.
Session I Chapter 10 - How to Work with Tables
HTML Tables CS 1150 Fall 2016.
8 Tables.
TABLES.
Web Design and Development
HTML Level II (CyberAdvantage)
Web Development & Design Foundations with H T M L 5
Usually use background-color:
Web Development & Design Foundations with HTML5
H T M L A B E S X P I N D.
Using tables in HTML Goes in order with Examples at my site.
Murach's HTML and CSS, 4th Edition
Site Development Foundations Lesson 6
ITI 134: HTML5 Desktop and Mobile Level II
Principles of Web Design 5th Edition
Lesson 5: HTML Tables.
1.3 TABLES.
H T M L A B E S X P I N D.
Hypertext Markup Language Table 11th Lecture
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

Muhammad Meer Hazaar (Software Engineer)

Lecturer CS Department GCUF Layyah Campus Contact: Muhammad Meer Hazaar Software Engineer Lecturer CS Department GCUF Layyah Campus meerhazaarkhan@yahoo.com Muhammad Meer Hazaar (Software Engineer)

Hyper Text Markup Language Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) HTML Tables Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) Table Tables are defined with the <table> tag. Tables are divided into table rows with the <tr> tag. Table rows are divided into table data with the <td> tag. A table row can also be divided into table headings with the <th> tag. Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <!DOCTYPE html> <html> <body> <table style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> </body> </html> Example Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <!DOCTYPE html> <html> <body> <table border="1" style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> </body> </html> Example With Border Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <table style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> </body> </html> Example with CSS Muhammad Meer Hazaar (Software Engineer)

An HTML Table with Collapsed Borders If you want the borders to collapse into one border, add CSS border-collapse: Example: table, th, td {     border: 1px solid black;     border-collapse: collapse; } Muhammad Meer Hazaar (Software Engineer)

An HTML Table with Cell Padding Cell padding specifies the space between the cell content and its borders. If you do not specify a padding, the table cells will be displayed without padding. Example: table, th, td {     border: 1px solid black;     border-collapse: collapse; } th, td {     padding: 15px; } Muhammad Meer Hazaar (Software Engineer)

Example with Collapse border and cell padding <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 15px; </style> </head> <body> <table style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> <p>Try to change the padding to 5px.</p> </body> </html> Example with Collapse border and cell padding Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) HTML Table Headings Table headings are defined with the <th> tag. By default, all major browsers display table headings as bold and centered: Example <table style="width:100%">   <tr>     <th>Firstname</th>     <th>Lastname</th>     <th>Points</th>   </tr>   Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <tr>     <td>Eve</td>     <td>Jackson</td>     <td>94</td>   </tr> </table> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) CSS text-align To left-align the table headings, use the CSS text-align property: Example: th {     text-align: left; } Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) Border Spacing Border spacing specifies the space between the cells. To set the border spacing for a table, use the CSS border-spacing property: Example: table {     border-spacing: 5px; } Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; padding: 5px; } table { border-spacing: 15px; </style> </head> <body> <table style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> <p>Try to change the border-spacing to 5px.</p> </body> </html> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) Span Many Columns To make a cell span more than one column, use the colspan attribute: Example: <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; </style> </head> <body> <h2>Cell that spans two columns:</h2> <table style="width:100%"> <tr> <th>Name</th> <th colspan="2">Telephone</th> </tr> <td>Bill Gates</td> <td>555 77 854</td> <td>555 77 855</td> </table> </body> </html> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) Span Many Rows To make a cell span more than one row, use the rowspan attribute: Example: <table style="width:100%">   <tr>     <th>Name:</th>     <td>Bill Gates</td>   </tr>   <tr>     <th rowspan="2">Telephone:</th>     <td>555 77 854</td>   </tr>   <tr>     <td>555 77 855</td>   </tr> </table> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) a Caption To add a caption to a table, use the <caption> tag: Example: <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; </style> </head> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <body> <table style="width:100%"> <caption>Monthly savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <td>January</td> <td>$100</td> <td>February</td> <td>$50</td> </table> </body> </html> Muhammad Meer Hazaar (Software Engineer)

A Special Style for One Table To define a special style for a special table, add an id attribute to the table: <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) table#t01 { width: 100%; background-color: #f1f1c1; } </style> </head> <body> <table style="width:100%"> <tr> <th>First Name</th> <th>Last Name</th> <th>Points</th> </tr> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> <br> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) <table id="t01"> <tr> <th>First Name</th> <th>Last Name</th> <th>Points</th> </tr> <td>Jill</td> <td>Smith</td> <td>50</td> <td>Eve</td> <td>Jackson</td> <td>94</td> <td>John</td> <td>Doe</td> <td>80</td> </table> </body> </html> Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) Output Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) And add more styles table#t01 tr:nth-child(even) { background-color: #eee; } table#t01 tr:nth-child(odd) { background-color: #fff; } table#t01 th { color: white; background-color: black; } Muhammad Meer Hazaar (Software Engineer)

Muhammad Meer Hazaar (Software Engineer) Output Muhammad Meer Hazaar (Software Engineer)