Tabellen rechts ausrichten
DJ Doena
- css
0 herbalizer
Hi,
im Zuge meiner Umstellung von Starr-HTML auf PHP wolt ich gleich von 4.01 Trans auf 4.01 Strict umstellen
mein problem
die beiden Tabellen sollen am rechten Browserrand ausgerichtet werden
so wars unter Trans
<div align="right">
<table> ... </table>
<table> ... </table>
</div>
jetzt versuchte ich Strict und CSS
<div style="text-align:right;">
<table> ... </table>
<table> ... </table>
</div>
Was unter IE6SP1 auch wunderbar klappt und laut CSS-Validator korrekt ist. Nur Mozilla 1.01 weigert sich, die Tabelle rechts auszurichten (was ja angesichts des Namen "text-align" nicht ganz unlogisch ist).
Aber wie krieg ich die Tabellen nach rechts? Thx
Hi!
jetzt versuchte ich Strict und CSS
<div style="text-align:right;">
<table> ... </table>
<table> ... </table>
</div>
Was unter IE6SP1 auch wunderbar klappt und laut CSS-Validator korrekt ist. Nur Mozilla 1.01 weigert sich, die Tabelle rechts auszurichten (was ja angesichts des Namen "text-align" nicht ganz unlogisch ist).
Wie üblich machts der IE falsch (obwohl da eigentlich im neuesten nicht vorkommen sollte, wenn er tatsächlich im Standardsmode ist).
text-align richtet Inline-Elemente aus, nicht aber Blockelemente! table ist ein Block-Element und wird daher über seine margins zum Elternelement ausgerichtet:
table {margin-left:auto; margin-right:0;}
Gruß Herbalizer
text-align richtet Inline-Elemente aus, nicht aber Blockelemente! table ist ein Block-Element und wird daher über seine margins zum Elternelement ausgerichtet:
table {margin-left:auto; margin-right:0;}
bei mir passiert da nix :-/ (die div hab ich jetzt rausgeworfen)
<body style="padding-bottom:0px; padding-right:0px; padding-top:0px; margin-bottom:0px; margin-right:0px; margin-top:0px; background-color:#960000; color:#000000;">
<table border="0" cellpadding="0" cellspacing="0" width="758" style="margin-right:0px;">
auch nicht mit margin-left:auto, ich kriegs einfach nicht vom linken rand weg :-(
Hallo,
Bei mir geht es so:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><body>
<table style="margin-left:auto; margin-right:0px">
<tr>
<td>
rechts
</td>
</tr>
</table>
</body></html>
Grüße aus Düsseldorf,
Aleksej
thx, funzt doch:
<body style="padding-bottom:0px; padding-right:0px; padding-top:0px; margin-bottom:0px; margin-right:0px; margin-top:0px; background-color:#960000; color:#000000;">
<table border="0" cellpadding="0" cellspacing="0" width="758" style="margin-left:auto;">