1.3 TABLES.

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

Designing Web Pages Tables part one. Using Tables for Page Layout 2.
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.
TABLES 6 How to create tables What information suits tables How to represent complex data in tables.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 Table1.html 1 2
Chapter 4 – Intermediate HTML 4 Outline 4.1 Unordered Lists 4.2 Nested and Ordered Lists 4.3 Basic HTML Tables 4.4 Intermediate HTML Tables and Formatting.
CIS101 Introduction to Computing Week 07. Agenda Your questions Resume project Review Project Two HTML Project Three This week online Next class.
Introducing Web Tables
Using 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.
HTML Tables and Forms Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
Chapter 5 Working with Tables. Agenda Add a Table Assign a Table Border Adjust Cell Padding and Spacing Adjust Cell Width and Height Add Column Labels.
XP 1 Tutorial 4 Designing a Web Page with Tables.
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.
CHAPTER 11 Tables. How Are Tables Used Data Display  Very tidy and very useful Better Text Alignment  Putting text in tables allows you to format indents.
INTRODUCTORY Tutorial 7 Creating Tables. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Discern the difference between data tables and.
Lecture: Tables. Table Tags (all container tags) establishes a table (________) establishes a row (________) says what’s in the row more than one TD within.
1 3/7/05CS120 The Information Era Chapter 4 Basic Web Page Construction TOPICS: More on tables and images.
>> Introduction to HTML: Tables. HTML is used to give websites structure 5 Basic Tags Element = Start-Tag+Content+End-Tag Heading Tags [h1-h6] Paragraph.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
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.
Tables in HTML. Table Tag HTML tables always begin and end with a table tag. Syntax:
Lesson 7. Tables Table Tags and Attributes Tables HTML tables are used in two main ways: 1.To organize tabular data in a familiar spreadsheet-like way.
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 5: Working with Tables Kelly L.
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.
Unit 4 Create and Use Tables. TITLE CORNELL NOTES TOPIC: NOTES: Name: Date: 09/08/2009 Period : Summary: Reasons for using tables Unit 4 Page 1 Display.
HTML Tables The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into.
Using Tables for Layout INP150 Session #8. Layout Map out your page Design with paper and pencil Determine number of rows and columns you need Determine.
Assistant Professor,UCER Naini,Allahabad
Creating Tables in a Web Site HTML 4 Created by S. Cox.
REEM ALMOTIRI Information Technology Department Majmaah University.
Tutorial 5: Tables Session OBJECTIVES Create a table Insert a table summary Insert a table caption Add rows and cells Merge Cells inside a Table.
Copyright © 2012 Certification Partners, LLC -- All Rights Reserved Lesson 5: HTML Tables.
Tables creating a table within a web page. What makes up a table? Columns Rows.
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.
CIS101 Introduction to Computing Week 07 Spring 2004.
Organizing Content with Lists and Tables
Web Development & Design Foundations with HTML5
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Working with Tables: Module A: Table Basics
>> HTML: Tables.
Web Development & Design Foundations with HTML5 8th Edition
LAB Work 02 MBA 61062: E-Commerce
HTML Tables CS 1150 Spring 2017.
Tutorial 5 Working with Tables and Columns
Introduction to HTML.
H T M L A B E S X P I N D.
HTML and CSS 8th Edition Chapter 18: Tables.
Using HTML Tables SWBAT: - create tables using HTML
TABLES.
HTML Tables & Frames Internet Technology.
Using rowspan and colspan attributes
Web Development & Design Foundations with H T M L 5
Using rowspan and colspan attributes
Web Development & Design Foundations with HTML5
H T M L A B E S X P I N D.
Site Development Foundations Lesson 6
Basic HTML.
Lesson 5: HTML Tables.
H T M L A B E S X P I N D.
Web Development & Design Foundations with HTML5
HTML Tables & Frames Internet Technology.
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

1.3 TABLES

A table is a collection of data (or) organization of data in tabular form i.e in the form of rows and columns. The different tags used to create tables in HTML are: <TABLE>: It defines a table. <TR>: It defines a Table Row. <TH>: It defines a Table Head. <TD>: It defines a Table Data. <caption>: It is used to give a short description of a table or brief description or explanation about the table and helps you understand its purpose. <thead>:

<th> S.NO ROLL NUMBER ATTENDANCE <tr> <tr> 1 15FE1A0501 75 2 15FE1A0502 85 <tr> <tr> <tr> <td>

S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85 The different attributes of <TABLE> tag are: (i) Border: When you create a table, it appears without border and looks incomplete because by default, the table border is set to zero.. You can add a border to a table using the following statement <table border=1> S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85

S.NO ROLL NUMBER ATTENDANCE (ii) Align: By default, the table in a web page is aligned to the left. S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85 You can also align the cell content using align attribute.

S.NO ROLL NUMBER ATTENDANCE By default, the table data is aligned to the left. S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85

S.NO ROLL NUMBER ATTENDANCE By default, the table head elements are aligned to center in bold font. S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85

(iii) Width:

(iv) bgcolor: If you want to change the background color for entire table, use the bgcolor attribute in the <table> tag. To specify a color for bgcolor attribute, you can use (i) RGB color codes (ii) Color names. You can find color names and color codes from the below link: https://www.w3schools.com/colors/colors_names.asp By default, the table background color is same as the background color of the page.

REALITY: (v) Cell spacing: S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85 HUMAN’S PERCEPTION: A table is a collection of data in rows and columns. REALITY: A table is a collection of data in rows and columns in the form of cells. S.NO ROLL NO ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85

(v) Cell spacing: It is used to specify the space between the borders of cells. It controls the space between table cells. Although there is no official default, browsers usually use a default of 2. Example: Cell spacing=50

Example: Cell spacing=10

Example: Cell spacing=0

Example: Cell spacing=1

The default value for cell padding is 1. (vi) Cell padding: It sets the amount of space between the contents of the cell and the cell wall. The default value for cell padding is 1. Example: Cell padding for a single cell “S.NO”. Cell padding=50 Cell padding=10 Cell padding=2 ****Cell padding is an attribute for table tag i.e it is applied to all the cells in the table. It cannot be applied to a single cell alone. But to explain an example, I have applied to a single cell.

The different attributes of <TR> tag are: (i) align (ii) bgcolor

The different attributes of <TH> and <TD> tags are: Align Width Bgcolor Rowspan Colspan

There are two types of tables (i) Simple Tables (ii) Complex Tables Simple Table: A simple table is a table which doesn’t contain spanned rows and columns. Complex Table: A complex table is a table which contains spanned rows and columns.

TAGS TO REMEMBER FOR CREATING SIMPLE TABLES <th> S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85 <tr> <tr> <tr> <td>

<table border = 1> <tr> <th> NAME </th> <th> FAVOURITE COLOR </th> </tr> <tr> <td> Sai Krishna </td> NAME FAVOURITE COLOR Sai Krishna Blue Naveen Yellow Sudheer Green <td> Blue </td> </tr> <tr> <td> Naveen </td> <td> Yellow </td> </tr> <tr> <td> Sudheer </td> <td> Green </td> </tr> </table>

<table border = 1> <tr> <th> S.NO </th> <th> ROLL NUMBER </th> <th> ATTENDANCE </th> </tr> <tr> 1 <td> </td> S.NO ROLL NUMBER ATTENDANCE 1 15FE1A0501 75 2 15FE1A0502 85 <td> 15FE1A0501 </td> <td> 75 </td> </tr> <tr> <td> 2 </td> <td> 15FE1A0502 </td> <td> 85 </td> </tr> </table>

Complex tables <th rowspan=“2”> dept </th> (Or) Complex Table: A complex table is a table which contains spanned rows and columns. Dept Dept Dept Dept Merge down Merge across <th rowspan=“2”> dept </th> (Or) <th colspan=“2”> dept </th> (Or) <td rowspan=“2”> dept </td> <td colspan=“2”> dept </td>

EXAMPLE 1: EXAMPLE 2: EXAMPLE 3: EXAMPLE 4: EXAMPLE 5: EXAMPLE 6: EXAMPLE 7: EXAMPLE 8: EXAMPLE 9:

EXAMPLE 10: EXAMPLE 11: EXAMPLE 13: EXAMPLE 12:

EXAMPLE-1 : COMPLEX TABLES

<table border=1> <tr> <th rowspan = 2> NAME </th> </tr> OUTPUT: NAME PHONE NUMBER LAND-LINE MOBILE RAVI 08593-24248 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> OUTPUT: PHONE NUMBER LAND-LINE MOBILE RAVI 08593-24248 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> </tr> OUTPUT: LAND-LINE MOBILE RAVI 08593-24248 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> OUTPUT: MOBILE RAVI 08593-24248 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> <tr> <td> RAVI </td> OUTPUT: </tr> RAVI 08593-24248 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> <tr> <td> RAVI </td> OUTPUT: <td> 08593-224248 </td> </tr> 08593-24248 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> <tr> <td> RAVI </td> OUTPUT: <td> 08593-224248 </td> <td> 9999999999 </td> </tr> 999999999 SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> <tr> <td> RAVI </td> OUTPUT: <td> 08593-224248 </td> <td> 9999999999 </td> </tr> <tr> <td> SAI </td> </tr> SAI 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> <tr> <td> RAVI </td> OUTPUT: <td> 08593-224248 </td> <td> 9999999999 </td> </tr> <tr> <td> SAI </td> <td> 08593-22412 </td> </tr> 08593-22412 888888888 </table>

<table border=1> <tr> <th rowspan = 2> NAME </th> <th colspan = 2> PHONE NUMBER </th> </tr> <tr> <th > LAND-LINE </th> <th > MOBILE </th> </tr> <tr> <td> RAVI </td> OUTPUT: <td> 08593-224248 </td> <td> 9999999999 </td> </tr> <tr> <td> SAI </td> <td> 08593-22412 </td> <td> 8888888888 </td> </tr> 888888888 </table>

EXAMPLE -2 : COMPLEX TABLES

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> OUTPUT: BILL SUMMARY S.NO ITEM NAME AMOUNT 1 RICE BAG 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> </tr> OUTPUT: S.NO ITEM NAME AMOUNT 1 RICE BAG 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> </tr> OUTPUT: ITEM NAME AMOUNT 1 RICE BAG 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> <th > AMOUNT </th> </tr> OUTPUT: AMOUNT 1 RICE BAG 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> <th > AMOUNT </th> </tr> <tr> <td > 1 </td> OUTPUT: </tr> 1 RICE BAG 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> <th > AMOUNT </th> </tr> <tr> <td > 1 </td> <td > RICE BAG </td> OUTPUT: </tr> RICE BAG 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> <th > AMOUNT </th> </tr> <tr> <td > 1 </td> <td > RICE BAG </td> <td > 1200 Rs </td> OUTPUT: </tr> 1200 Rs TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> <th > AMOUNT </th> </tr> <tr> <td > 1 </td> <td > RICE BAG </td> <td > 1200 Rs </td> OUTPUT: </tr> <tr> <td colspan = 2> TOTAL </td> </tr> TOTAL 1200 Rs </table>

<table border=1> <tr> <th colspan = 3> BILL SUMMARY </th> </tr> <tr> <th > S.NO </th> <th > ITEM NAME </th> <th > AMOUNT </th> </tr> <tr> <td > 1 </td> <td > RICE BAG </td> <td > 1200 Rs </td> OUTPUT: </tr> <tr> <td colspan = 2> TOTAL </td> <td > 1200 Rs </td> </tr> 1200 Rs </table>

EXAMPLE 1: EXAMPLE 2: DEPT EMP. INFORMATION E. NO E. NAME SALARY CSE 294 SAI 24,000 EEE 259 TEJA 29,000 EXAMPLE 2: LIFE EXPECTANCY OTHER EXPECTANCY MEN WOMEN MEN WOMEN 82 85 78 82

EXAMPLE 3: EXAMPLE 4: SAI KRISHNA MORNING AFTERNOON MONDAY FREE BUSY TUESDAY FREE WEDNESDAY BUSY EXAMPLE 4: I II III IV 1 2 3 4

EXAMPLE 5: SAI TEJA FAVOURITE COLOR BLUE YELLOW SPORT CRICKET TENNIS

EXAMPLE 6: Invoice Item Description Qty Unit Price Price Paper Clips 100 1 100 Paper 10 45 450 Waste paper Baskets 2 10 20 Subtotal 570 Tax 7% 39 Total Bill Amount 609