Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
502 views

Unit II - Lesson 9 - HTML Table

This document discusses how to create and structure tables in HTML. It explains that tables allow arranging data into rows and columns and lists some common uses of tables. It then outlines the basic table structure using <table>, <tr>, <th>, and <td> tags to define the table, rows, header cells, and regular cells. The document also describes several table attributes for styling tables, including border, bordercolor, cellspacing, cellpadding, align, bgcolor, and valign. It explains how colspan and rowspan attributes are used to merge or combine cells across columns and rows.

Uploaded by

mllalaguna
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
502 views

Unit II - Lesson 9 - HTML Table

This document discusses how to create and structure tables in HTML. It explains that tables allow arranging data into rows and columns and lists some common uses of tables. It then outlines the basic table structure using <table>, <tr>, <th>, and <td> tags to define the table, rows, header cells, and regular cells. The document also describes several table attributes for styling tables, including border, bordercolor, cellspacing, cellpadding, align, bgcolor, and valign. It explains how colspan and rowspan attributes are used to merge or combine cells across columns and rows.

Uploaded by

mllalaguna
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Table, Creating Tables in Web Page, Table Structure, Table Attributes, and TD and TH Attributes

Tables allow the author to arrange data elements such as text and images into columns and rows.
Uses of Tables:
There are complicated layouts that only table tags can solve. It help us to organize our data.

Use <table></table> to insert table. Tables are composed of rows, columns and cells.

Columns

Rows

Cells

<table><!--tag used to create table--> <tr> <th>Header</th> <td>Data</td> </tr> </table>

TABLE

ROW

HEADER

ROW DATA

<tr>
It is used to define the row of the table. One pair of <tr> is equivalent to one row.

<th>
It is used to define the header. Anything between these tags will be in bold format and aligned at the center.

<td>
It is used to define table data. Anything between these tags will be in regular data and aligned at left side. s

BORDER
This defines the thickness of the border. The value of border attribute is any number in pixels. <table border=5>

BORDER COLOR
This defines the color of the border. Value is in any color name or hexadecimal codes. <table bordercolor=red> <table bordercolor=DB0702>

CELLSPACING
It defines the spacing in between cells. It has a default spacing value of 2 pixels. <table cellspacing= 10>

CELLPADDING
Specifies the space between the cells content and its borders. <table cellpadding=5>

ALIGN
It is used to align the table to the right, center or left . By default, the table is aligned to the left. <table align=center>

BGCOLOR
It defines the color of the cell. Place this attribute to <tr> tag to apply the color to the entire row to minimize the use of bgcolor on either <th> or <td>. <th bgcolor=red>

VALIGN
It is used to align cells content vertically. The value of valign is the direction either top, middle or bottom. <th valign=middle>Headre</th>

COLSPAN
It is used to combine 2 or more columns. The value of colspan is the number of columns you wish to merge or combine. <th colspan=4>Header</th>

ROWSPAN
It is used to combine 2 or more rows. The value of rowspan is the number of rows you wish to merge or combine.

Type the given source codes to come up of the following output:

Prepare for a quiz tomorrow about the following topics:


Lesson 6.10 Lesson 6.11 HTML Lists HTML Tables

Study ... Study... Study... Super Happy Learning! Prepared by Mr. Marlon Lalaguna

You might also like