Josh: Tabellen mit CSS formatieren

Beitrag lesen

Guten Morgen,

ich versuche gerade eine Tabelle mit CSS zu formatieren. Nach meinen Informationen ist das CLASS-Attribut auch im COL-Tag erlaubt, demnach sollte bei dem folgenden Code die rechte Spalte rechtsbündig ausgerichtet sein, und einen linken Rahmen sowie einen gelben Hintergrund haben.

TABELLE.CSS

body {
  Color: #000000;
  Background-Color: #efefef;
  margin: 0em;
  padding: 0em;
  font-size: 101%;
  Font-Family: Verdana, Arial, Helvetica;
  Font-Variant: normal;
  Font-Weight: normal;
  Font-Style: normal;
  Line-Height: normal;
  }

col {
  display: table-column;
  }
.rot {
  background-color: #ff0000;
  padding: 1em;
  }

.gelb {
  background-color: #ffff00;
  text-align: right;
  padding: 1em;
  border: 2px solid black;
  }

TABELLE.HTM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="GENERATOR" content="PPWIZARD version 04.051 on WIN98, FREE tool for Windows, OS/2, DOS and UNIX by Dennis Bareis (http://www.labyrinth.net.au/~dbareis/ppwizard.htm)">
  <title>Pecunia non olet</title>
  <link rel="stylesheet" href="../formate/tabelle.css" type="text/css" />
</head>
<body>
<p>&nbsp;</p>
  <table border="0" width="80%" cellspacing="0" cellpadding="0">
   <colgroup>
     <col class="rot" />
     <col class="gelb" />
   </colgroup>
   <tr>
     <td>Erste Spalte</td>
     <td>Zweite Spalte</td>
   </tr>
  </table>
</body>
</html>

Das ist leider nicht der Fall, wie Ihr hier sehen könnt.

http://www.jho64.de/pecunia/test/tabelle.htm

Kann mir jemand erklären wie es funktioniert?

Vielen Dank und einen schönen Sonntag
Josh

P.S.: An alle fußballbegeisterten Griechen - Viel Glück! ;-))