Next / Previous / Contents / TCC Help System / NM Tech homepage

6. Basic data types

Many of XHTML's attributes use a set of standard data types such as lengths, names, and so on. The following sections describe these standard data types.

6.1. The length datatype

To specify a linear dimension, you can use any of these forms:

  • A number by itself is interpreted as a number of pixels.

  • A number followed by a percent sign (%) is interpreted as some percentage of available space. For example, if an element fills the width of the screen, the length “50%” would mean half the width of the screen.

  • When describing the columns of a table, you can specify their widths as a number followed by an asterisk (*). The available width is then parceled out proportionally among those numbers. For example, if you specify the widths of the columns of a three-column table as “1*”, “2*”, and “3*”, the first column would get 1/6 of the available width, the second column would get 1/3 (2/6), and the third column would get half (3/6).