LillyChamp: Tabelle und CSS Frage

Hi,

ich habe eine Tabelle und möchte gerne. Jede Zeile durch einen Strich trennen. Folgender Code macht das was ich will:

<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200"><b>Kundennummer</b></td>
    <td width="200"><b>Name</b></td>
    <td width="200"><b>Firma</b></td>
  </tr>
  <tr valign="top">
    <td style="border-bottom:solid 2px;border-bottom-color:#006699" bordercolor="#006699">123</td>
    <td style="border-bottom:solid 2px;border-bottom-color:#006699" bordercolor="#006699">Jens</td>
    <td style="border-bottom:solid 2px;border-bottom-color:#006699" bordercolor="#006699">Test</td>
  </tr>
  <tr valign="top">
    <td style="border-bottom:solid 2px;border-bottom-color:#006699" bordercolor="#006699">124</td>
    <td style="border-bottom:solid 2px;border-bottom-color:#006699" bordercolor="#006699">Mark</td>
    <td style="border-bottom:solid 2px;border-bottom-color:#006699" bordercolor="#006699">Test2</td>
  </tr>
</table>

Geht das auch besser ohne das ich ein externes css brauche oder dass ich der Tabelle nur 1x den Style geben muss?

LillyChamp

  1. Hi,

    Geht das auch besser ohne das ich ein externes css brauche oder dass ich der Tabelle nur 1x den Style geben muss?

    Mal grob entsorgt:

      
    <style>  
     .Kundenliste th { width:200px; text-align:left; }  
     .Kundenliste td { border-bottom:2px solid #069; }  
    </style>  
      
    <table class="Kundenliste" border="0" cellspacing="0" cellpadding="0">  
      <tr>  
        <th>Kundennummer</th>  
        <th>Name</th>  
        <th>Firma</th>  
      </tr>  
      <tr valign="top">  
        <td>123</td>  
        <td>Jens</td>  
        <td>Test</td>  
      </tr>  
      <tr valign="top">  
        <td>124</td>  
        <td>Mark</td>  
        <td>Test2</td>  
      </tr>  
    </table>  
    
    

    Gruß, Cybaer

    --
    Hinweis an Fragesteller: Fremde haben ihre Freizeit geopfert, um Dir zu helfen. Helfe Du auch im Archiv Suchenden: Beende deinen Thread mit einem "Hat geholfen" oder "Hat nicht geholfen"!
  2. hi,

    Geht das auch besser ohne das ich ein externes css brauche

    Warum willst du denn kein "externes CSS" benutzen?

    Die Formatierungen auszulagern, dürfte in einer Vielzahl denkbarer Fälle die "bessere" und sauberere Lösung sein.

    gruß,
    wahsaga

    --
    /voodoo.css:
    #GeorgeWBush { position:absolute; bottom:-6ft; }