Table

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Table as PDF for free.

More details

  • Words: 697
  • Pages: 4
F.4 CIT – HTML – Table

page 1

Introduction A table is composed a number of cells and described by the number of rows and columns. In HTML, tables is defined by tag and cells are specified by Tag: It defines the body of a table separate from any header or footer. Usage:
and tags. Text, image or other tags which can be put in the tag can also be put into table cells. Also, the cells in tables can be merged and split. However, in HTML, different rows can have different number of cells. Due to the flexibility of tables, tables provide designers with broader applications. One of the applications is image slicing, a function which can be found in many latest graphics software. Defining Table In defining a table, a number of tags are used together. These tags includes: , , , , and Tag: It creates a table header that browsers can pace intelligently when dealing with long tables. Usage:
,
.

Tag: It creates a table. Usage:


Attributes: 1.

align:

Alignment of the text inside. Possible value: CENTER | LEFT | RIGHT

2.

background: Background image of the table

3.

bgcolor:

Background colour of the table

4.

cols:

Number of columns

5.

height, width:

Height and width of the table. Possible value: number of pixels | auto

6.

border:

7.

cellpadding: Distance between the cell border and its content

8.

cellspacing: Distance between two cells

Width of table border

...


Attributes: 1.

align:

CENTER | LEFT | RIGHT

2.

valign: TOP | MIDDLE | BOTTOM | BASELINE

3.

background

4.

bgcolor

F.4 CIT – HTML – Table

page 2

... … ...


Attributes: The same as tag.

Tag: It creates a table footer. Usage:
... ...


Attributes: The same as tag.

Tag: It defines a row in a table. Usage: | | ...... | |


Attributes: Similar to other tags of a table.

Tag: It defines header cells ni tag. Content enclosed by the tag is center-justified and bold. Usage:

F.4 CIT – HTML – Table

page 3

... ...
Header 1 Header 2


Attributes: Similar to other tags of a table, except that supports rowspan and colspan.

Tag: It defines a table cell. Usage: ... ...
Cell 1 Cell 2


Attributes: Same as tags.

Merging Cells Cells can be merged by using colspan and rowspan attributes in and . colspan merges horizontal neighbouring cells while rowspan merges vertical neighbouring cells. The values of colspan or rowspan specifies the number of cells that are merged. Example:

F.4 CIT – HTML – Table

page 4

1 2
3 4


Draw the result shown on your browser.

Image Slicing We can put images into table cells, and different images can be put together yet retain the sizes of the images and the structure of the table. Such flexibility is done by using the colspan and rowspan attributes. Due to this flexibility, a large image is cut into smaller pieces (called slices) for download and such technique is called image slicing. Image slicing improves the download speed of large images because a number of slices can be downloaded at the same time and some of the slices can be replaced, thus reducing the overall image size. In writing code for image slicing, we have to note the following: 1. Border size, cellspacing and cellpadding attributes should be set to 0 2. Images of pure colour is replaced by cell with the same background colour 3. Cells without image (those mentioned in (2)) should have a content &nbdp;, Otherwise, the table cell will collapse. Although image slicing is useful, it is tedious to write the HTML code. Therefore, many latest graphics Exercise: 1. Apply image slicing by using Macromedia Firework. 2. Change the values of different attributes. 3. Open the HTML source code and try to understand the codes.

Related Documents

Table
November 2019 80
Table
November 2019 78
Table
May 2020 28
Table
November 2019 58
Table
October 2019 65
Table
July 2020 23