Knut: css und tabellen (padding im css und im tag)

hallo zusammen,

habe ein kniffliges problem mit css & tabellen und komme nicht weiter:

habe folgende tabellen definert:

table {
     border: 0px;
     margin: 0px;
     border-collapse: collapse;
     padding: 0px;
     spacing: 0px;
     width: 100%;
}

table.main{
     background-color: #FFF;
     width : 990px;
     border:0px;
     padding: 0px;
     spacing: 0px;
   }

1. Ist es notwendig in allen Tabellen (hier table.main) nochmal padding und cellspacing zu definieren oder reicht es im einmal mit table?

2. In der tabelle main wird immer ein padding von 1 angezeigt (IE6)
bei folgendem html (die tabelle rutscht einen px nach unten und nach rechts):
<table class="main_frame">

mit der cellpadding-angabe im tag klappt es dann:

<table class="main_frame" cellpadding="0"> ist alles ok.

Hat jemand eine idee, woran das liegt?

Danke schon mal vorab und lg
knut

  1. Hi,

    table {
         border: 0px;
         margin: 0px;
         border-collapse: collapse;
         padding: 0px;
         spacing: 0px;

    es gibt keine CSS-Eigenschaft namens spacing. Meinst Du border-spacing?

    1. Ist es notwendig in allen Tabellen (hier table.main) nochmal padding und cellspacing zu definieren oder reicht es im einmal mit table?

    da der Selektor "table" auf jede Tabelle zutrifft, ist es nicht nötig, für "table.main" nochmal padding zu setzen.
    Mit cellspacing meinst Du vermutlich border-spacing?

    1. In der tabelle main wird immer ein padding von 1 angezeigt (IE6)

    Das dürfte das cellspacing sein, das Du ja nicht im CSS unterdrückt hast...

    bei folgendem html (die tabelle rutscht einen px nach unten und nach rechts):
    <table class="main_frame">

    Vermeide Unterstriche in class-Names. Diese wurden erst in den Errata zu CSS2 zugelassen...

    Hat jemand eine idee, woran das liegt?

    Ja, s.o.

    cu,
    Andreas

    --
    MudGuard? Siehe http://www.mud-guard.de/
    1. hallo und danke für die antwort.

      das mit dem unterstrich war mir neu.

      die lösung meines problems ist folgende:

      ein padding-style für table gibt es nicht direkt.
      allerdings ist folgendes möglich:

      td {
           padding: 0px;
      }

      damit ist die tabelle so wie gewollt.

      lg