data-alignment-004.xht (1386B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Aligning Table Data (column data is aligned)</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#tables-intro" /> 7 <meta name="assert" content="Alignment of cell data in a column is achieved by specifying alignment properties on the cells themselves, and not on the column element directly." /> 8 <style type="text/css"> 9 col 10 { 11 text-align: center; 12 vertical-align: middle; 13 } 14 td 15 { 16 border: solid; 17 height: 10em; 18 text-align: left; 19 vertical-align: top; 20 width: 10em; 21 } 22 </style> 23 </head> 24 <body> 25 <p>Test passes if the "Filler Text" is in the top-left corner of each of the boxes below.</p> 26 <table> 27 <col /> 28 <tr> 29 <td>Filler Text</td> 30 </tr> 31 <tr> 32 <td>Filler Text</td> 33 </tr> 34 <tr> 35 <td>Filler Text</td> 36 </tr> 37 </table> 38 </body> 39 </html>