• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Zeilen in Tabelle viel zu hoch

Jean-Luc

Neues Mitglied
Hallo ihr Wissenden :D

ich plage mich seit zwei Tagen mit einem wirklich blöden Problem.

Ich habe einige PHP/MySQL Seiten erstellt wo bestimmte Werte einer Datenbank in Tabellenform darstellt werden sollen. (Was anderes kann ich leider nicht).

Mein Problem ist aber simples HTML :-?, denn die Zeilen der Tabelle sind im Browser viel zu hoch. Ich habe alle mir bekannten high-Einstellungen ausprobiert, nichts funktioniert.

Eine verkürzte Fassung einer der Ausgabeseiten:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 100%;
font-weight: bold;
vertical-align: middle;
}
.style2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 100%;
font-weight: bold;
color: #FFFFFF;
background-color: #3293B3;
}
.style3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 100%;
font-weight: bold;
vertical-align: middle;
background-color: #CCCCCC;
}
-->
</style>
</head>
<body>
<table width="1400" border="0" cellpadding="0" cellspacing="4" class="style1" style="line-height:16px">
<tr>
<td width="180" rowspan="46">&nbsp;</td>
<td width="260">&nbsp;</td>
<td width="938" bgcolor="#3293B3"><blockquote class="style2">Mainheader</blockquote></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#3293B3"><blockquote class="style2">Header 1</blockquote></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><blockquote class="style3">Value 1</blockquote></td>
<td bgcolor="#CCCCCC"><blockquote class="style3">xxxx</blockquote></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><blockquote class="style3">Value 2</blockquote></td>
<td bgcolor="#CCCCCC"><blockquote class="style3">xxxx</blockquote></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#3293B3"><blockquote class="style2">Header 2</blockquote></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><blockquote class="style3">Value 3</blockquote></td>
<td bgcolor="#CCCCCC"><blockquote class="style3">xxxx</blockquote></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><blockquote class="style3">Value 4</blockquote> </td>
<td bgcolor="#CCCCCC"><blockquote class="style3">xxxx</blockquote></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#3293B3"><blockquote class="style2">Header 3</blockquote></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><blockquote class="style3">Value 5</blockquote></td>
<td bgcolor="#CCCCCC"><blockquote class="style3">xxxx</blockquote></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><blockquote class="style3">Value 6</blockquote></td>
<td bgcolor="#CCCCCC"><blockquote class="style3">xxxx</blockquote></td>
</tr>
</table>
</body>
</html>

Die Zeilen sollen jeweils nur so groß sein wie der Text, sehen aber (z.B. im IE) so aus:
IE.jpg

Ich arbeite mit Windows XP, Dreamworks CS2, IE 6.0.2900, Firefox 3.6.13

Hat jemand eine Idee was ich falsch mache oder anders machen könnte?

Danke
Jean-Luc
 
Ja, arbeite mit CSS. Auch wenn Du Tabellen einsetzt dient CSS zur Gestaltung dieser. Mit

Code:
* { margin: 0;padding: 0; }

kannst Du erstmal alle Innen- und Außenabstände zurücksetzen. Danach solltest Du dir die Zeilenhöhe (line-height) anschauen.
 
Zurück
Oben