table-layout
Andy
- css
Hi,
wie und wann funktioniert eigentlich das blöde table-layout:fixed eigentlich?
Ich hab eine Tabelle:
--------------------------------------
Überschrift |
---|
Inhalt |
-------------------------------------- |
Werbung |
-------------------------------------- |
Zwischen den Strichen zwischen Inhalt und Text soll ein 2px-breites Bild, was jetzt aber egal ist.
Was stimmt hier nicht?
<table border="1" style="table-layout:fixed">
<tr>
<td colspan="3" style="height:52px; width:802px"><img border="0" src="bilder/banner.jpg" width="800" height="52"></td>
</tr>
<tr>
<td style="width:95px" valign="top">
</td>
<td style="width:1px"></td>
<td style="width:606px; height:500px" valign="top">
</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
</table>
Andy
Hi,
Was stimmt hier nicht?
1. Du vernachlässigst padding und border-spacing (cellpadding/cellspacing).
<table border="1" style="table-layout:fixed">
<tr>
<td colspan="3" style="height:52px; width:802px"><img border="0" src="bilder/banner.jpg" width="800" height="52"></td>
also 802px + ein paar für padding/spacing
</tr>
<tr>
<td style="width:95px" valign="top">
</td>
<td style="width:1px"></td>
<td style="width:606px; height:500px" valign="top">
also 702px + ein paar mehr für padding/spacing
Also ein Unterschied von ca. 100px...
cu,
Andreas
Hi,
das funktioniert aber leider auch nicht:
<table border="0" style="table-layout:fixed">
<tr>
<td colspan="3" style="height:52px; width:802px"><img border="0" src="bilder/banner.jpg" width="800" height="52"></td>
</tr>
<tr>
<td style="width:95px" valign="top">
</td>
<td style="width:1px"></td>
<td style="width:706px; height:500px" valign="top">
</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
</table>
Andy