|
||||
![]()
Hallo,
ich möchte gerne mit schlankem und elegantem (also gerne ohne Verrenkungen) CSS erreichen, dass CAPTION stets exakt die gleiche Breite einnimmt wie die zugehörige Tabelle. Details: * Tabelle ist mit kollabierenden Rahmen gestaltet * Zellen und Caption besitzen dasselbe Padding * Caption soll keinen Rahmen besitzen * Caption soll sich von Aussenkante Rahmen links bis Aussenkante Rahmen rechts erstrecken. In Firefox z.B. bleibt beim Testcase stets eine "Treppenstufe" zwischen Caption und Tabelle. In Opera oder IE nicht. Vermutlich habe ich Tomaten auf den Augen. Oder doch nicht? Testcase: http://borumat.de/test-caption.php Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="de" xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <title>Tabelle mit Caption</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> body{ background: gray; } table{ border-collapse: collapse; } table caption{ background: green; padding: 0.3em; margin: 0; } table th{ background: red; border: 5px solid white; padding: 0.3em; } table td{ background: yellow; border: 5px solid white; padding: 0.3em; } </style> </head> <body> <h1>Tabelle mit Caption </h1> <table> <caption>Lorem</caption> <tr> <th>Ipsum</th> <td>Doloret</td> </tr> <tr> <th>Sit</th> <td>Amet</td> </tr> </table> </body> </html>
__________________
|
Sponsored Links |
|
|||
![]()
Du hast keine Tomaten auf den Augen. Aber Firefox und Safari folgen hier der Spezifikation, auch wenn es unsinnig erscheint.
http://www.w3.org/TR/CSS21/tables.ht...apsing-borders The collapsing border model weiter unten, unter der Grafik: Zitat:
|
Sponsored Links |
![]() |
Themen-Optionen | |
Ansicht | |
|
|
![]() |
||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Aktuelle Größe von Tabelle bekommen (dynamische Erzeugung der Tabelle) | internet | (X)HTML | 17 | 03.12.2014 10:05 |
Tabelle soll in DIV 100% breit sein | jannemann | (X)HTML | 10 | 31.08.2011 09:52 |
Außenabstand: Problem bei TABLE und CAPTION | AndreasB | CSS | 2 | 23.05.2009 10:59 |
Tabelle: Zellenhöhe 100% / Zelle zu breit | yoitsme | CSS | 1 | 02.01.2007 22:00 |
Caption so breit wie Tabel | AndreasB | CSS | 4 | 15.11.2006 16:46 |