Creating Tables in HTML

Slides:



Advertisements
Similar presentations
Using HTML Tables Presenting Information & Layout Control.
Advertisements

Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
Tables Page layout Tables Tables are the bread and butter of HTML page layout. Youve made nice Office tables right? Well, same sort of thing, but we are.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 6: HTML Tables.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 Table1.html 1 2
Tutorial 4: Designing a Web Page with Tables
Introducing Web Tables
HTML TABLES Cyndi Hageman. Tables   Attributes Name or id – used to identify the table Border = set this to determine if there is a border and the size.
Using HTML Tables.
1 Tables: Data in Rows and Columns – What is Table? – How Tables are Used? – Designing Tables – Table, Cell, Row Attributes – Using Tables for Alignment.
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.
Images and Tables. Displaying Image Attributes: SRC= " mypic.gif " – Name of the picture file SRC= " pic/mygif.jpg " – Name of file found in pic directory.
Notes Ch. 12—Creating Tables Web Page Design. Why Use Tables? Tables are used to create a variety of items such as calendars, charts, and spreadsheets.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
Using HTML to Create Tables in Web pages Connie Lindsey November 2005.
HTML Essentials Tables and Table Tags. Overview Use of Tables goes beyond tabulating data Frequently used to format Web pages / control layout Especially.
1 XHTML Tables A table is a matrix of cells, for displaying content in rows and columns The cells can include almost any element Some cells display row.
Identifies the Structure Table Row Column 1 Table Heading Column 2.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorial 5: Working with Tables.
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.
Internet Skills An Introduction to HTML Alan Noble Room 504 Tel: (44562 internal)
Lecture: Tables. Table Tags (all container tags) establishes a table (________) establishes a row (________) says what’s in the row more than one TD within.
HTML Overview Part 4 – Tables 1. HTML Tables  Tables are defined with the tag pair.  A table is divided into rows with tag pairs. o tr stands for "table.
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 2.
Introducing Web Tables. Tables for tabulating items  Better looking  More flexibility  More efficient to explain information than plain text.
A table is a rectangular arrangement of rows and columns on your screen A table is used to organize data into rows and columns and also increasingly.
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.
Tables Web Authoring. This kind of a table THISIs aTABLE THISIs aTABLE THISIs aTABLE THISIs aTABLE.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
Tables in HTML. Table Tag HTML tables always begin and end with a table tag. Syntax:
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 CS 105. Page Structure HTML elements control the details of how a page gets displayed. Every HTML document has the following basic structure: … …
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.
REEM ALMOTIRI Information Technology Department Majmaah University.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Block-Level Elements.
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.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Week 6 Creating Tables using HTML.
>> HTML: Tables.
LAB Work 02 MBA 61062: E-Commerce
HTML Tables.
Tutorial 5 Working with Tables and Columns
Programming the Web using XHTML and JavaScript
Introduction to HTML.
H T M L A B E S X P I N D.
TABLES.
Creating Tables Steps for creating a Table Important Facts about Table
Creating Tables Steps for creating a Table Important Facts about Table
Using HTML Tables SWBAT: - create tables using HTML
TABLES.
TABLES IN HTML No, not that kind of table!! THIS KIND!!
Web Design and Development
Creating Tables in HTML
HTML Tables & Frames Internet Technology.
Web Development & Design Foundations with H T M L 5
COMS 161 Introduction to Computing
Formatting with tables
H T M L A B E S X P I N D.
Site Development Foundations Lesson 6
Basic HTML.
Creating Tables Steps for creating a Table Important Facts about Table
Lesson 5: HTML Tables.
H T M L A B E S X P I N D.
HTML Tables & Frames Internet Technology.
Presentation transcript:

Creating Tables in HTML Tables are used to neatly display information on a web page Tables are also used to control web page layout (where we place text and images on the page) Tables can be useful when creating borders around images and text on your page 09 December 2018 Ivailo Chakarov

Table Parts Row Horizontal line of data Item Price T-Shirt £5-99 Trousers £21-99 Coat £59-99 Header Cell Contains text that describes the data in a row or column Data Cell Contains data 09 December 2018 Ivailo Chakarov

Defining the table <TABLE> tag Simply defines that a table will exist No border or content are created <TABLE> </TABLE> There will be a table here ! 09 December 2018 Ivailo Chakarov

The table will have a border which will be 1 pixel wide Creating a table border <TABLE BORDER="1"> Defines a border of 1 pixel width <TABLE BORDER="1"> </TABLE> The table will have a border which will be 1 pixel wide 09 December 2018 Ivailo Chakarov

Creating a table row <TR> tag Used to create a new row No content created as yet The tag does not need to be closed <TABLE BORDER="1"> <TR> </TABLE> 09 December 2018 Ivailo Chakarov

Creating a header cell <TH> tag Used to create a header cell (describing other data) Does not need to be closed The content follows the cell’s definition <TABLE BORDER="1"> <TR> <TH>Item <TH>Price </TABLE> Item Price 09 December 2018 Ivailo Chakarov

Creating a data cell <TD> tag Used to create a data cell Does not need to be closed The content follows the cell’s definition <TABLE BORDER="1"> <TR> <TH>Item <TH>Price <TR> <TD>T-Shirt <TD>£5-99 </TABLE> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

A Few Points to Mention The table would expand as much as necessary to accommodate the content (provided you have not specified a width for it) By default, the header cell (<TH>) tags make the content placed in them bold and centred By default, the data cell (<TD>) tags render the content placed in them aligned to the left You can place any content you wish in the cells (images, lists, paragraphs, etc.) 09 December 2018 Ivailo Chakarov

Specifying the table’s width <TABLE WIDTH="100"> Defines a width for the table, 100 pixels wide <TABLE BORDER="1" WIDTH="100"> <TR> <TH>Item <TH>Price <TR> <TD>T-Shirt <TD>£5-99 </TABLE> 100 pixels Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Specifying the table’s height <TABLE HEIGHT="100"> Defines a height for the table, 100 pixels wide <TABLE BORDER="1" WIDTH="100" HEIGHT="50"> <TR> <TH>Item <TH>Price <TR> <TD>T-Shirt <TD>£5-99 </TABLE> Item Price T-Shirt £5-99 50 pixels 09 December 2018 Ivailo Chakarov

Specifying the size of a cell <TD WIDTH="200" HEIGHT="100"> Defines a width and height for a particular cell Affects column width and row height of which the cell is part of <TABLE BORDER="1"> <TR><TH>Item <TH>Price <TR> <TD WIDTH="200" HEIGHT="100"> T-Shirt <TD>£5-99 </TABLE> Item Price T-Shirt £5-99 100 pixels 200 pixels 09 December 2018 Ivailo Chakarov

Centring a table <CENTER><TABLE>…………</TABLE></CENTER> By default the table is left-aligned; centre it as follows <CENTER> <TABLE BORDER="1" WIDTH="100"> <TR><TH>Item <TH>Price <TR><TD>T-Shirt <TD>£5-99 </TABLE> </CENTER> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Aligning Data Horizontally <TD ALIGN="center"> <TD ALIGN="right"> To align a data cell horizontally use the ALIGN attribute By default, the cell is aligned to the left <TABLE BORDER="1" WIDTH="100"> <TR> <TH>Item <TH>Price <TR> <TD ALIGN="center">T-Shirt <TD ALIGN="right">£5-99 </TABLE> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Aligning Data Vertically <TD VALIGN="top"> <TD VALIGN="middle"> <TD VALIGN="bottom"> To align a data cell vertically use the VALIGN attribute By default, the cell is aligned in the middle <TABLE BORDER="1" WIDTH="100"> <TR> <TH>Item <TH>Price <TR> <TD VALIGN="top">T-Shirt <TD VALIGN="bottom">£5-99 </TABLE> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Changing a row’s background <TR BGCOLOR="yellow"> To change the colour of a row just use BGCOLOR attribute <TABLE BORDER="1" WIDTH="100"> <TR BGCOLOR=“yellow"> <TH>Item <TH>Price <TR> <TD VALIGN="top">T-Shirt <TD VALIGN="bottom">£5-99 </TABLE> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Changing a cell’s background <TD BGCOLOR="red"> To change the colour of a cell just use BGCOLOR attribute <TABLE BORDER="1" WIDTH="100"> <TR BGCOLOR=“yellow"> <TH>Item <TH>Price <TR> <TD VALIGN="top" BGCOLOR="red">T-Shirt <TD VALIGN="bottom">£5-99 </TABLE> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Changing a table’s background colour <TABLE BGCOLOR="yellow"> To change a table’s background colour use BGCOLOR attribute <TABLE BORDER="1" WIDTH="100“ BGCOLOR="yellow"> <TR> <TH>Item <TH>Price <TR> <TD VALIGN="top">T-Shirt <TD VALIGN="bottom">£5-99 </TABLE> Item Price T-Shirt £5-99 09 December 2018 Ivailo Chakarov

Changing cell spacing <TABLE CELLSPACING="10"> You can change the amount of space between each cell Default spacing is 2 pixels <TABLE BORDER="1" WIDTH="200" CELLSPACING="10"> <TR> <TH>Item <TH>Price <TR> <TD VALIGN="top">T-Shirt <TD VALIGN="bottom">£5-99 </TABLE> 09 December 2018 Ivailo Chakarov

Changing cell padding <TABLE CELLPADDING="10"> You can change the amount of space around the contents of each cell; Default cell padding is 1 pixel <TABLE BORDER="1" WIDTH="200“ CELLPADDING="10"> <TR> <TH>Item <TH>Price <TR> <TD VALIGN="top">T-Shirt <TD VALIGN="bottom">£5-99 </TABLE> 09 December 2018 Ivailo Chakarov