Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 27.09.2011, 09:52
Daniel86 Daniel86 ist offline
Neuer Benutzer
neuer user
Thread-Ersteller
 
Registriert seit: 24.07.2011
Beiträge: 17
Daniel86 befindet sich auf einem aufstrebenden Ast
Standard Tabelle Rahmen schwarz, Zellen grau

Hallo Forum,
kann mir wer sagen, wie ich eine Tabelle mittels CSS so formatiere, dass ich einen schwarzen 1px Rahmen habe und graue 1px Gitternetzlinien?

so gehts nicht:
Beispiel

HTML-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <style type="text/css">
         #Produktbeschreibung td, #Produktbeschreibung th {
                             padding:0 5px;
                             border-width: 1px;
                             border-style: solid;
                             border-color: #CCCCCC;
                             }


         #Produktbeschreibung table {
                             border-width: 1px;
                             border-style: solid;
                             border-color: #000000;
                             border-collapse: collapse;
                             margin-bottom: -1px;
                             }
         </style>
</head>

<body>
<div id="Produktbeschreibung">



<table summary="Produktdetails">
         <colgroup>
             <col width="400" />
             <col width="100" />
         </colgroup>
         <th colspan="2">Leistung</th>                                                          </tr>
         <tr>    <td>Nennspannung</td>                 <td>12V</td>                                     </tr>

         <th colspan="2">Elektrische Merkmale</th>
         <tr>    <td>Temperaturkoeffizient von I<sub>sc</sub> (&alpha;)</td> <td>0,0745%/°C</td>             </tr>
         <tr>    <td>Maximale Systemspannung</td>                       <td>50V</td>                    </tr>
</table>
<table summary="Produktdetails">
         <colgroup>
            <col width="150" />
            <col width="350" />
         </colgroup>
         <th colspan="2">Mechanische Merkmale</th>
         <tr>    <td>Maße</td>                <td>Länge: 364mm Breite: 287mm Tiefe: 28mm</td>            </tr>
         <tr>    <td>Aufbau</td>              <td>Front: Hochdurchlässiges 3,2mm gehärtetes Glas<br />
</table>





</div><!--Ende Produktbeschreibung!-->
</body>
</html>

und noch eine Frage: kann ich innerhalb einer Tabelle eine neue Spaltenbreite definieren? Hier habe ich ja eine neue Tabelle angelegt, um eine neue Spaltenbreite zu bekommen, finde ich etwas unelegant.

Danke für eure Hilfe!
Mit Zitat antworten
Sponsored Links