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.

Slides:



Advertisements
Similar presentations
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.
Advertisements

XP Tutorial 4New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Designing a Web Page with Tables Tutorial 4 Creating a News Page.
Chapter 3 – Web Design Tables & Page Layout
Designing Web Pages Tables part one. Using Tables for Page Layout 2.
Tutorial 5 Working with Web Tables
Internet Basics & Way Beyond!
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure with HTML.
New Perspectives on Creating Web Pages with HTML
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
Cos 125 Day 22. Agenda Assignment 6 Not corrected Waiting for tune-ins Assignment 7 is posted Assignment 7 Due April 2PM Left to do 1 Assignments.
© 2004, Robert K. Moniot Chapters 4 & 5 Introduction to HTML, More Details.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
XP 1 New Perspectives on Creating Web Pages with HTML Tutorial 4: Designing a Web Page with Tables.
XP 1 Designing a Web Page with Tables Tutorial 4 Creating a News Page.
Cos 125 Day 24. Agenda All students meeting 7 Pm Monday, April 19 UMS Strategic Plan Assignment #7 Posted Due April 20 Two (one?) more to go Quiz Four.
Creating a Web Page with Tables. Objectives Create a text table with preformatted text Create the basic structure of a graphical table Organize table.
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.
Using HTML Tables.
The Power of Tables They aren't just for sitting stuff on anymore...
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.
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 Tables and Forms Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
HTML Essentials Tables and Table Tags. Overview Use of Tables goes beyond tabulating data Frequently used to format Web pages / control layout Especially.
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.
XHTML1 Tables N100 Creating a Simple Web Page. XHTML2 Creating Basic Tables Tables are collections of rows and columns that you use to organize and display.
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.
INTRODUCTORY Tutorial 7 Creating Tables. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Discern the difference between data tables and.
Tutorial 5 Working with Web Tables. XP Objectives Explore the structure of a Web table Create headings and cells in a table Create cells that span multiple.
CNIT 132 – Week 7 HTML - Tables. Tables on the World Wide Web A table can be displayed on a Web page either in a text or graphical format. A text table:
Tutorial 5 Working with Tables and Columns
Tutorial 5 Working with Tables and Columns
XP Creating Web Pages with HTML, 3e Prepared by: C. Hueckstaedt, Tutorial 4 1 New Perspectives on Creating Web Pages with HTML Tutorial 4: Designing a.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
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.
Tutorial 5 Working with Web Tables. XP Objectives Explore the structure of a Web table Create headings and cells in a table Create cells that span multiple.
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:
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.
HTML ( HYPER TEXT MARK UP LANGUAGE ). What is HTML HTML describes the content and format of web pages using tags. Ex. Title Tag: A title It’s the job.
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.
Designing a Web Page with Tables Maureen Smith Professor, Saddleback College Tutorial 4.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
COS 125 DAY 14. Agenda  Assignment 6 DUE  Assignment 7 Posted Due March 9:35 AM  Quiz 2 will be on March 30 Chapters M/C and 4 Short.
LINKING WEBPAGES USING HTML HYPERLINKS. Hyperlinks are text strings or images on a webpage which when clicked on, links to another section in the same.
Tutorial 5 Working with Web Tables. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Learn and Apply the structure of.
Tutorial 5 Working with Web Tables
Designing a Web Page with Tables
CNIT 131 HTML5 - Tables.
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Working with Tables: Module A: Table Basics
LAB Work 02 MBA 61062: E-Commerce
Tutorial 5 Working with Tables and Columns
Tutorial 5 Working with Web Tables
New Perspectives on Creating Web Pages with HTML
Using HTML Tables SWBAT: - create tables using HTML
TABLES.
Presentation transcript:

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 characters A graphical table: is displayed using graphical elements can include design elements such as background colors, and colored borders with shading allows you to control the size of tables cells, rows, columns and alignment of text within the table A table can be displayed on a Web page either in a text or graphical format. Tables on the World Wide Web

A Text Table This figure shows a text table.

A Graphical Table This figure shows a graphical table

Graphical Tables Defining a Table Structure The first step to creating a table is to specify the table structure: –the number of rows and columns –the location of column headings –the placement of a table caption Once the table structure is in place, you can start entering data into the table

Using the,, and Tags Graphical tables are enclosed within a two- sided tag that identifies the start and ending of the table structure Each row of the table is indicated using a two- sided (for table row) Within each table row, a two-sided (for table data) tag indicates the presence of individual table cells

The Graphical Table Syntax The general syntax of a graphical table is: First Cell Second Cell Third Cell Fourth Cell –This creates a table with two rows and two columns

A Simple Table The layout of a graphical table two rows two columns

HTML Structure of a Table beginning of the table structure first row of six in the table end of the table structure table cells You do not need to indent the tags or place them on separate lines, but you may find it easier to interpret your code if you do so. After the table structure is in place, you’re ready to add the text for each cell.

Creating Headings with the Tag HTML provides the tag for table headings Text formatted with the tag is centered within the cell and displayed in a boldface font The tag is most often used for column headings, but you can use it for any cell that you want to contain centered boldfaced text

Adding Table Headings to the Table Text in cells formatted with the tag is bold and centered above each table column Row of table headings

Result of Table Headings as Displayed in the Browser table headings appear bold and centered over their columns

Identifying the Table Heading, Body, and Footer HTML allows you to identify the different parts of your table using the,, and tags – is used for the table heading – is used for the table body – is used for the table footer These tags do not format the table, but they do contain collections of rows called row groups

The Table Heading, Body, and Footer Syntax The table heading, body, and footer syntax is: heading information... footer information... first group of table rows... second group of table rows...

Table Heading, Body, and Footer A single table can contain several tags to identify different parts of the table The and sections must appear before any sections in the table structure These tags are most often used in a table that draws its data from an external data source, or tables that span several Web pages The browser will repeat those sections across multiple pages Not all browsers support this capability

Creating a Table Caption HTML allows you to specify a caption for a table The syntax for creating a caption is: caption text –alignment indicates the caption placement –a value of “bottom” centers the caption below the table –a value of “top” or “center” centers the caption above the table –a value of “left” or “right” place the caption above the table to the left or right

Table Captions Internet Explorer also supports the “center” value for a caption. Older browsers only support “top” and “bottom” because HTML 3.2 only specified these options The tag works only with tables, the tag must be placed within the table structure Captions are shown as normal text without special formatting Captions can be formatted by embedding the caption text within other HTML tags –for example, place the caption text within a pair of and tags causes the caption to display as bold and italic

Inserting a Table Caption caption will be centered above the table caption text Placing the caption text within a pair of tags causes the caption to display as bold

Result of a Table Caption table caption A table with caption

Modifying the Appearance of a Table You can modify the appearance of a table by adding: –gridlines –borders –background color HTML also provides tags and attributes to control the placement and size of a table

Working with the Table Border By default, browsers display tables without table borders A table border can be added using the border attribute to the tag The syntax for creating a table border is: … –value is the width of the border in pixels The size attribute is optional; if you don’t specify a size, the browser creates a table border 1 pixel wide

Tables with Different Borders Values The effect on a table’s border when the border size is varied

Adding a 5-Pixel Border to a Table Only the outside border is affected by the border attribute; the internal gridlines are not affected

Table Frames and Rules The frame attribute was introduced in HTML therefore might not be supported in older browsers With the frame and rule attributes you can control how borders and gridlines are applied to the table The frames attribute allows you to determine which sides of the table will have borders The frame attribute syntax is: … –type is either “box” (the default), “above”, “below”, “hsides”, “vsides”, “lhs”, “rhs”, or “void”

Values of the Frame Attribute

Effect of Different Frame Values

Creating Frames and Rules The rules attribute lets you control how the table gridlines are drawn The syntax of the rules attribute is: … –type is either “all”, “rows”, “cols”, or “none”

Effect of Different Rules Values

Sizing a Table Cell Spacing The cell spacing attribute controls the amount of space inserted between table cells The syntax for specifying the cell space is: … –value is the width of the interior borders in pixels –the default cell spacing is 2 pixels Cell spacing refers to the space between the cells

Tables with Different Cell Spacing Values Different cell spacing values and a table’s appearance

Setting the Cell Spacing to 0 Pixels Setting the cellspacing to 0 reduces the width of the borders between individual table cells. This will not remove the border between the cells.

Cell Padding To control the space between the table text and the cell borders, add the cell padding attribute to the table tag The syntax for this attribute is: … –value is the distance from the table text to the cell border, as measured in pixels –the default cell padding value is 1 pixel Cell padding refers to the space within the cells

Tables with Different Cell Padding Values The effect of changing the cell padding value for a table

Setting the Cell Padding to 4 Pixels A table with an increased amount of cell padding. By increasing the cell padding, you added needed space to the table.

Working with Table and Cell Size The size of a table is determined by the text it contains in its cells By default, HTML places text on a single line As you add text in a cell, the width of the column and table expands to the edge of the page –once the page edge is reached, the browser reduces the size of the remaining columns to keep the text to a single line You can insert a line break, paragraph or heading tag within a cell

Working with Table and Cell Size When the browser can no longer increase or decrease the size of the column and table it wraps the text to a second line As more text is added, the height of the table expands to accommodate the additional text It is important to manually define the size of the table cells and the table as a whole

Defining the Table Size The syntax for specifying the table size is: –size is the width and height of the table as measured in pixels or as a percentage of the display area To create a table whose height is equal to the entire height of the display area, enter the attribute height=“100%” If you specify an absolute size for a table in pixels, its size remains constant, regardless of the browser or monitor settings used Remember that some monitors display Web pages at a resolution of 640 by 480 pixels

Setting the Width of the Table to 70% of the page width

Setting Cell and Column Sizes To set the width of an individual cell, add the width attribute to either the or tags The syntax is: width=“value” –value can be expressed either in pixels or as a percentage of the table width –a width value of 30% displays a cell that is 30% of the total width of the table

Setting Cell and Column Sizes The height attribute can be used in the or tags to set the height of individual cells The height attribute is expressed either in pixels or as a percentage of the height of the table If you include more text than can be displayed within that height value you specify, the cell expands to display the additional text

Spanning Rows and Columns To merge several cells into one, you need to create a spanning cell A spanning cell is a cell that occupies more than one row or column in a table Spanning cells are created by inserting the rowspan and colspan attribute in a or tag. The syntax for these attributes is: … –value is the number of rows or columns that the cell spans in the table

Spanning Rows and Columns When a cell spans several rows or columns, it is important to adjust the number of cell tags used in the table row When a cell spans several rows, the rows below the spanning cell must also be adjusted

Example of Spanning Cells This cell spans two columns and two rows This cell spans three columns This cell spans three rows

A Table Structure with a Row-Spanning Cell HTML code resulting table four table cells in the first row only three table cells are required for the second and third rows

Adding Spanning Cells to a Table this cell spans two columns these cells span three rows

Results of a Table with Spanning Cells spanning cells

Aligning the Contents of a Table By default, cell text is placed in the middle of the cell, aligned with the cell’s left edge By using the align and valign attributes, you can specify the text’s horizontal and vertical placement To align the text for a single column, you must apply the align attribute to every cell in that column

Values of the align and valign attributes

Working with Column Groups Tags allow you to manipulate the features of entire columns and groups of columns –this feature is currently only supported by Internet Explorer 4.0 or above, and not at all by Netscape –this feature shouldn’t be used if your page is to be viewed by multiple browsers and browser versions To define a column, add the following tag to the top of the table structure: –value is the number of columns in the group The tag supports the align, bgcolor, valign, and width attributes

The Tag Another way of grouping columns is by using the tag The syntax of the tag is: <colgroup span=“value” columns –value is the number of columns in the group, and columns are definitions for individual columns within the group (defined using the tag.) In the event of a conflict between the attributes in the and tags, the tag attributes take precedence

Using Tables for Layout HTML tables are most often used to define the layout of an entire Web page If you want to design a page that displays text in newspaper style columns, or separates the page into distinct sections, you’ll find tables an essential and useful tool

Using Tables for Layout Columnar layout: page content is placed in columns Sectional layout: page is broken into sections, placing each section into its own table Jigsaw table or jigsaw layout: page content is broken into separate pieces to create almost any kind of layout

Fixed-width and Fluid Layouts Fixed-width layout: Web designer defines exact size of every table element in absolute units such as pixels –Gives designer precise control over appearance, but does not take into account the size of the browser window Fluid layout: one or more table elements are sized as a percentage of the page width –Page content flows into blank areas as the size of the browser window increases, but sometimes results in long lines of text

Creating a Newspaper-Style Layout Create two tables inside another– nested tables

Using Nested Table Tables can be created within another table making the Web page easier to manage