Table Row Attributes

line.gif

Horizontal Alignment

The attribute align of the tag <tr> has possible values of left, center or right.
Examples of each are generated by the following code.

<table cellpadding=5 border=2 width=20%>
<tr align=left>   <td> A
<tr align=center> <td> B
<tr align=right>  <td> C
</table>

whereby the table is rendered as shown below.

A
B
C

Vertical Alignment

By default, row entries are centered vertically. This may be inconvenient on occasions.
For example, consider the following table.

<table cellpadding=5 border=2 width=90%>
<tr> <td> <b>Notes</b>
<td>I++ is amongst the largest and cleanest C++
class libraries in the computer science.
i++ encapsulates the entire Windows programming interface twice -
once in C++ and once in C.
</table>

The above table is rendered below.

Notes I++ is amongst the largest and cleanest C++ class libraries in the computer science. i++ encapsulates the entire Win32 programming interface twice - once in C++ and once in C.

You will notice that "Notes" is centered vertically in its cell (the default). Perhaps the preferred position may be at the top left corner. The may be achieved as follows.

<table class=indent cellpadding=5 border=2 width=95%>
<tr> <td valign=top> <b>Notes</b>
<td>I++ makes full use of C++ exceptions and templates. Effectively,
i++ brings C based operating systems into the modern era of object
oriented languages - like no other system. In summary,
i++ is a Virtual C++ Operating System.
</table>

whereby the table is rendered as shown below.

Notes I++ makes full use of C++ exceptions and templates. Effectively, i++ brings C based operating systems into the modern era of object oriented languages - like no other system. In summary, i++ is a Virtual C++ Operating System.

Clearly, the attribute valign of the tag <tr> has placed the word "Notes" in the desired position.

The next section next.gif discusses the attributes that may be applied to a cell in a table.