TABLES IN HTML No, not that kind of table!! THIS KIND!!

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

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.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 6: HTML Tables.
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.
Tutorial 4: Designing a Web Page with Tables
Introducing Web Tables
XP Creating Web Pages with HTML Using Tables. XP Objectives Create a text table Create a table using the,, and tags Create table headers and captions.
Introduction to HTML II Shih-Heng Chin. Preface Structure of a HTML File Elements used frequently Tables.
Using HTML Tables.
Tables And Lists. Slide 2 Lecture Overview Learn about the basics of tables Create simple 2-dimensional tables Format tables Create tables with complex.
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.
What is a TABLE? The HTML table allows web designers to arrange & organize data -- text, images, hyperlinks, forms, form fields, other tables, etc. Tables.
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.
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.
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.
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.
HTML Comprehensive Concepts and Techniques Second Edition Project 3 Creating Tables in a Web Site.
Lecture: Tables. Table Tags (all container tags) establishes a table (________) establishes a row (________) says what’s in the row more than one TD within.
>> 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.
Creating Tables in a Web Site
Tables Module 2: HTML Basics LESSON Extension. Module 2: HTML Basics LESSON Extension Lesson Overview In this lesson, you will learn to:  Create tables.
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.
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.
Kevin Murphy Introduction to Tables Masters Project CS 490.
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.
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.
CS-3432 Electronic Commerce Lecture – 7 Sikandar Shujah Toor
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.
TABLES IN HTML No, not that kind of table!! THIS KIND!!
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 5.
CIS101 Introduction to Computing Week 07 Spring 2004.
CSE 154 Lecture 17: HTML tables.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Week 6 Creating Tables using HTML.
Survey of Computer Science CSCI 110, Spring 2011 Lecture 23 HTML
H T M L A B E S X P I N D.
>> HTML: Tables.
Tables and Frames.
LAB Work 02 MBA 61062: E-Commerce
HTML Tables CS 1150 Spring 2017.
HTML Tables.
Introduction to HTML.
H T M L A B E S X P I N D.
TABLES.
HTML/XML HTML Authoring.
Using HTML Tables SWBAT: - create tables using HTML
TABLES.
LESSON Extension Module 2: HTML Basics Tables.
If You Know Nothing About HTML, This is Where You Start.
Creating Tables in HTML
COMS 161 Introduction to Computing
H T M L A B E S X P I N D.
Site Development Foundations Lesson 6
Basic HTML.
H T M L A B E S X P I N D.
Hypertext Markup Language Table 11th Lecture
Presentation transcript:

TABLES IN HTML No, not that kind of table!! THIS KIND!!

Why use tables on a web page? Easier to align data, even with a border of 0 Organized and neat Easy to read

To add a table To do a table, you must have a beginning and ending table tag <table> </table>

For example: <html> <head><title>Tables</title></head> <body> <table border=“1”> <tr>This is row 1</tr> </table> </body> </html>

Table Borders Add border=“n” if you wish to include a border around your table and its cells. Even if you don’t want a border, you should still include the border tab at 0. Instead of <table> use <table border=“1”> </table> Wait until you master tables before trying one without a border

<table border=“2”> Table Rows Each row has a beginning and ending tag <tr> </tr> <table border=“2”> <tr> </tr> </table>

Cells / Columns To make another column you create a separate cell with the <td> tag (ending tag also </td>) <table border=“3”> <tr><td bgcolor=“#ff8000” font color=“#804000”> column 1</td> <td>column 2</td> <td>column 3</td> </tr> </table>

Heading Cells If you want your columns to have labels or column headings, use the table heading tags These will center and bold your headings in the middle of your columns <table border=“3”><tr> <th>Heading 1></th> <th>Heading 2</th><th>Heading 3</th> </tr> </table> U:\Lburgess\my web pages\my favorites.html

Table Span To make the table go all the way across the page, put in a width code in the initial table tag Example: <table border=“1” width=“100%”>

Changing Text Alignment in a Cell You can change the text alignment to left, center or right. And, you can change the text alignment to top, middle or bottom of the cell. To do so, you add an alignment tag to your column tag <td> <td align=“center”> <td valign=“top”> <tr align> works also, but affects the entire row

Your Turn Create a three column, three row table with a header row. You will need to set the width to 100% to cover the entire page. Center align your text within the second column. Your table should contain Disney character names in the first column, the name of the movie they are from in the second column, and an image of the character in the third column. HINT: <img src> code goes in place of the text in column 3

Let’s Review To add a border to your table <table border=“#”> To create a table without a border <table border=“0”> <tr> </tr> defines a row <td> </td> defines a column To center text within a cell of a table <td align=“center”> To make a table go across the entire page, use the width attribute <table width=“100%”>

Let’s Review To create a heading for your columns <th> replaced <td> on first row To vertically align the text in cells use valign <td valign=“center”> To add a hyperlink inside the table <td><a href=“http://www.websiteaddress.com”> website address</a></td> To add a picture inside a table <td><img src=“picture.jpg”></td>

Make a padded Tic-Tac-Toe Board What will this table look like? <table border=“1”> <tr><th>Col 1</th><th>Col 2</th><th>Col 3</th></tr> <tr><td>X</td><td>X</td><td>X</td></tr> </table>

To increase the amount of space between cells or between text and cells To add space between the cell wall and the text <table border=“1” cellpadding=“#”> To add space between cells <table border=“1” cellspacing=“#”> The # represents pixels of space

Let’s add some room to the Tic-Tac-Toe Board <table border=“1” cellpadding=“10”> <tr><th>Col 1</th><th>Col 2</th><th>Col 3</th></tr> <tr><td>X</td><td>X</td><td>X</td></tr> </table> <table border=“1” cellpadding=“10” cellspacing=“10”> <tr><th>Col 1</th><th>Col 2</th><th>Col 3</th></tr> <tr><td>X</td><td>X</td><td>X</td></tr> </table>

Changing Row Span or Column Span You can span more than one row or more than one column Adding rowspan to a td tag will “take over” more than one row <rowspan=“2”> Adding colspan to a td tag will span more than one column <colspan=“2”>

This is an example of a rowspan of 2.

This is an example of a column span of 2.

Practice Row/Column Span Look on p. 189 of keyboarding textbook See if you can duplicate the table which appears in Activity 2 on Major League Baseball

Designing a Table You should absolutely draw your table on paper first to see what you want it to look like before creating your html document. Once you draw your table on paper, then you will be able to see what type of tags you will need.

What if you want links inside your table? To create a table that looks like this one And links to those web pages CBS Home Page WPHS Home Page The tags would be as follows <tr><td align=“center”> <a href=http://www.cbs.com>CBS Home Page </a></td> What would the WPHS Tag look like?