HTML Tables The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into.

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

Chapter 3 – Web Design Tables & Page Layout
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure 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.
Creating a Web Page with Tables. Objectives Create a text table with preformatted text Create the basic structure of a graphical table Organize table.
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.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
Using HTML Tables.
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.
 Tables are commonly used to display all manner of data, such as timetables, financial reports, and sports results etc.  Tables, just like spreadsheets,
Tutorial #8 – Creating Data Tables. Tutorial #6 Review – Layouts Two Column Fixed Width, Three Column Fixed Width Class VS. ID Container Universal Selector.
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.
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.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
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.
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
Actual Building the Pages Tables. Using Table Elements  To build effective page templates, you must be familiar with the HTML table elements and attributes.
10/4/2015Tables1 Spring, 2008 Modified by Linda Kenney 4/2/08.
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:
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.
Tutorial 5 Working with Tables and Columns
Tutorial 5 Working with Tables and Columns
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.
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.
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.
 2003 Prentice Hall, Inc. All rights reserved. Introduction to HTML: Tables Outline 1 Introduction 2 Basic HTML Tables 3 Intermediate HTML Tables and.
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
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.
Chapter 5 Working with Tables Principles of Web Design, 4 th Edition.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
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.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
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.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Block-Level Elements.
Tables creating a table within a web page. What makes up a table? Columns Rows.
Designing a Web Page with Tables
Organizing Content with Lists and Tables
Yourfriendmanoj.wordpress.com Fb/yourfriendmanoj
Working with Tables: Module A: Table Basics
>> HTML: Tables.
Web Development & Design Foundations with HTML5 8th Edition
Tables and Frames.
LAB Work 02 MBA 61062: E-Commerce
HTML Tables CS 1150 Spring 2017.
Tutorial 5 Working with Tables and Columns
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Programming the Web using XHTML and JavaScript
Chapter 7 Tables.
H T M L A B E S X P I N D.
Lesson 7 Week 7 Course project defence Nov. 7, 2017
HTML and CSS 8th Edition Chapter 18: Tables.
Using HTML Tables SWBAT: - create tables using HTML
Implementing Tables to Hold Data in HTML
Introduction to HTML.
H T M L A B E S X P I N D.
Principles of Web Design 5th Edition
H T M L A B E S X P I N D.
Hypertext Markup Language Table 11th Lecture
Basics of Web Design Chapter 9 Table Basics Key Concepts
Presentation transcript:

HTML Tables The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into rows and columns of cells. Each table may have an associated caption that provides a short description of the table's purpose. Table rows may be grouped into a head, foot, and body sections, (via the thead, tfoot and tbody elements, respectively). When long tables are printed, the head and foot information may be repeated on each page that contains table data. HTML Tables tMyn

You need to know about four basic table tags, as described: Table cells may either contain "header" information (see the th element) or "data" (see the td element). Cells may span multiple rows and columns. You need to know about four basic table tags, as described: HTML Tables tMyn

Elementary tags for building a HTML Table: The table tag is a container for every other tag used to create a table in HTML. The opening and closing table tags should be placed at the beginning and the end of your table. <tr> </tr> The tr tag stands for table row. The opening and closing tr tags surround the cells for that row. <th> </th> The th tag stands for table header. An optional tag used instead of the td tag, this tag defines a cell containing header information. By default, the content in header cells is bolded and centered. <td> </td> The td tag stands for table data and holds the actual content for the cell. There is an opening and closing td tag for each cell in each row. HTML Tables tMyn

First table example employs some elementary tags: HTML Tables tMyn

HTML Tables tMyn

Tables, by nature of their design, have internal and external borders. By default, most browsers set the border to zero, making them invisible (see the previous example). To make the border visible, use border attribute: <table border=“3”> The larger the number you specify, the thicker the borders become. Another useful table attribute might be frame attribute. HTML Tables tMyn

Two attributes can be added to the table tag: When the borders are visible for a table, it’s easier to see how much space is around the content and in between the cells. Two attributes can be added to the table tag: cellbadding: space between the content within the cell and the edges of that cell. cellspacing: space in between each of the individual cells. Increasing the cell padding can give extra buffer space around the text, so it doesn’t run into the borders. Increasing cell spacing allows for a gutter between multiple cells. HTML Tables tMyn

The caption tag enables you to specify captions for your tables. This tag is a stand-alone element used after the table tag (see the next example) but before the first table row. At times, you might have content in a cell that needs to be kept on a single line. In cases lake this, you can add the nowrap attribute to your td or th tag, which tells the browser to try and keep all the content in that cell on a single line if at all possible. HTML Tables tMyn

Three tags in particular are used to group rows within tables: thead: table header tfoot: table footer tbody: table body Using these tags the browser is able to differentiate between the header and footer information, and the main content of the page. The header information is repeated at the top of each page or screen view of the table, even if the table is printed. HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

We can add the colspan attribute to a td or th tag to merge cells across two or more columns: HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

Likewise we can add the rowspan attribute to a td or th tag to merge cells across two or more rows: HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

Next example modifies the Nordic countries table by implementing external style sheet: HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

Some explanations to the previous example: white-space: nowrap; This value collapses whitespace as for 'normal', but suppresses line breaks within text. em: the font-size of the relevant font ex: the ’x-height’ of the relevant font px: pixels, relative to the viewing device HTML Tables tMyn

td {padding: 0.25em 0.25em 0.25em 0.25em}; The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element. The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once. In that case the order is padding-top, padding-right, padding-bottom and padding-left,so for example td {padding: 0.25em 0.25em 0.25em 0.25em}; HTML Tables tMyn

First example divides text into two columns: Now let us talk about using tables to lay out an entire page, regardless of whether it looks like it would fit into a grid or a table structure. First example divides text into two columns: HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

If we set the border value to 0, that gets us started. The table we just dissected didn’t look like the typical table when we first viewed it. One of the reasons is this is a seamless table, or one in which the cells are flush up against one another, without borders to separate them. To turn a regular table into a seamless table, you must set several attributes in the table tag to 0, to eliminate any extra space around the table cells. If we set the border value to 0, that gets us started. HTML Tables tMyn

Next example achieves exactly the same as the previous one but now using the external style sheet: HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

Let us modify the external style sheet: The apparent problem with the previous example is that the text starts too near the left border in the first column. Let us modify the external style sheet: HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

HTML Tables tMyn

A nested table is one contained within the cell of another table. This can be useful when you need to create a completely different table structure in one portion of a page, which cannot be incorporated into the structure of the rest of the page. HTML Tables tMyn