1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
3 <!-- ***** BEGIN LICENSE BLOCK *****
4 Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 The contents of this file are subject to the Mozilla Public License Version
7 1.1 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
9 http://www.mozilla.org/MPL/
11 Software distributed under the License is distributed on an "AS IS" basis,
12 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 for the specific language governing rights and limitations under the
16 The Original Code is mozilla.org Code.
18 The Initial Developer of the Original Code is
19 Netscape Communications Corporation.
20 Portions created by the Initial Developer are Copyright (C) 1998-1999
21 the Initial Developer. All Rights Reserved.
25 Alternatively, the contents of this file may be used under the terms of
26 either of the GNU General Public License Version 2 or later (the "GPL"),
27 or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 in which case the provisions of the GPL or the LGPL are applicable instead
29 of those above. If you wish to allow use of your version of this file only
30 under the terms of either the GPL or the LGPL, and not to allow others to
31 use your version of this file under the terms of the MPL, indicate your
32 decision by deleting the provisions above and replace them with the notice
33 and other provisions required by the GPL or the LGPL. If you do not delete
34 the provisions above, a recipient may use your version of this file under
35 the terms of any one of the MPL, the GPL or the LGPL.
37 ***** END LICENSE BLOCK ***** -->
41 <title>Vertical alignment and table height
</title>
42 <meta http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-1">
43 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
44 <link rel=
"copyright" href=
"/~dbaron/legal.html">
45 <style type=
"text/css">
47 /* XXX Should really remove black */
48 table td
{ border: thin solid black
; }
50 table
.one
{ height: auto
; }
51 table
.two
{ height: 30px; }
52 table
.three
{ height: 500px; }
53 table
.four
, table
.five
{ height: 50%; }
54 div
.five
{ height: 600px; border: medium solid purple
; }
56 tr
.auto
{ height: auto
; }
57 tr
.small
{ height: 2px; }
58 tr
.big
{ height: 200px; }
60 table
.baseline td
{ vertical-align: baseline
; }
61 table
.middle td
{ vertical-align: middle
; }
62 table
.top td
{ vertical-align: top
; }
63 table
.bottom td
{ vertical-align: bottom
; }
65 span
.big
{ font-size: 400%; }
67 table
.cellsmall td
{ height: 2px; }
68 table
.cellauto td
{ height: auto
; }
70 td
.baselinea
{ vertical-align: baseline
; }
71 td
.baselineb
{ vertical-align: text-bottom
; }
72 td
.baselinec
{ vertical-align: text-top
; }
73 td
.baselined
{ vertical-align: super
; }
74 td
.baselinee
{ vertical-align: sub
; }
75 td
.baselinef
{ vertical-align: -12px; } /* probably correct */
76 td
.baselineg
{ vertical-align: 40%; } /* probably correct */
77 td
.top
{ vertical-align: top
; }
78 td
.middle
{ vertical-align: middle
; }
79 td
.bottom
{ vertical-align: bottom
; }
81 td
.big
{ font-size: 300%; }
82 td
.biggest
{ font-size: 600%; }
87 <h1>Vertical alignment and table height
</h1>
89 <p>In each of the following tables the cells with 'Data' should all have the same baseline:
</p>
93 <td class=
"baselinea">Data
</td>
94 <td class=
"baselineb big">Data
</td>
95 <td class=
"baselinec biggest">Data
</td>
96 <td class=
"top">Top
</td>
97 <td class=
"middle">Middle
</td>
98 <td class=
"bottom">Bottom
</td>
104 <td class=
"top">Top
</td>
105 <td class=
"middle">Middle
</td>
106 <td class=
"bottom">Bottom
</td>
107 <td class=
"baselined biggest">Data
</td>
108 <td class=
"baselinee">Data
</td>
109 <td class=
"baselinef big">Data
</td>