XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   CSS (http://xhtmlforum.de/forumdisplay.php?f=73)
-   -   Tabelle Rahmen schwarz, Zellen grau (http://xhtmlforum.de/showthread.php?t=65846)

Daniel86 27.09.2011 09:52

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!

kadees 29.09.2011 01:18

HTML-Code:

<div id="Produktbeschreibung" style="border: 1px solid rgb(0, 0, 0); width: 500px; padding-bottom: 1px;">
...funktioniert in deinem Beispiel - ohne Garantie :lol:

Daniel86 29.09.2011 23:05

Es scheint wohl keine direkte Definition zu geben...
so geht's ja auch.
THX 4 helping!


Alle Zeitangaben in WEZ +2. Es ist jetzt 13:48 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023