PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : html-Programmierung von Tabellen



HaWe
02.12.2017, 12:15
hallo,
ich versuche mich gerade in einer html-Programmierung von Tabellen.
es sollte so hübsch aussehen wie hier:
33092
https://wiki.selfhtml.org/wiki/HTML/Tabellen/Aufbau_einer_Tabelle

ich habe es mal mit Beispielwerten versucht, aber ich bekomme keine eingerahmten Tabellenfelder, lediglich die Tabs stimmen:


QUELLE
°C inn rF % T min T max °C ext - T min T max
10.1 88 -1 18 8.8 - -2.2 10.1
0 11 22 33 44 - - -
espA0 Erde1 Erde2 muxA2 muxA3 - - -

der Test-Sourcecode sieht z.Zt so aus (für esp8266 nodeMCU):


script+= "<table> ";

script+= " <caption>QUELLE</caption> ";

script+= " <thead> ";
script+= " <tr> ";
script+= " <th>°C inn</th> ";
script+= " <th>rF %</th> ";
script+= " <th>T min</th> ";
script+= " <th>T max</th> ";
script+= " <th>°C ext</th> ";
script+= " <th> - </th> ";
script+= " <th>T min</th> ";
script+= " <th>T max</th> ";
script+= " </tr> ";
script+= " </thead> ";

script+= " <tbody> ";
script+= " <tr> ";
script+= " <th>10.1</th> ";
script+= " <th>88</th> ";
script+= " <th>-1</th> ";
script+= " <th>18</th> ";
script+= " <th>8.8</th> ";
script+= " <th> - </th> ";
script+= " <th>-2.2</th> ";
script+= " <th>10.1</th> ";
script+= " </tr> ";

script+= " <tr> ";
script+= " <th>0</th> ";
script+= " <th>11</th> ";
script+= " <th>22</th> ";
script+= " <th>33</th> ";
script+= " <th>44</th> ";
script+= " <th> - </th> ";
script+= " <th> - </th> ";
script+= " <th> - </th> ";
script+= " </tr> ";

script+= " </tbody> ";

script+= " <tfoot> ";
script+= " <tr> ";
script+= " <th>espA0</th> ";
script+= " <th>Erde1</th> ";
script+= " <th>Erde2</th> ";
script+= " <th>muxA2</th> ";
script+= " <th>muxA3</th> ";
script+= " <th> - </th> ";
script+= " <th> - </th> ";
script+= " <th> - </th> ";
script+= " </tr> ";
script+= " </tfoot> ";


script+= " </table> ";



was fehlt noch in meinem Code, um die Tabellen-Felder mit Rahmen und Farben hervor zu heben?

Bumbum
02.12.2017, 14:37
Hallo HaWe,

die Beschreibung für das Design ist doch in deinem Link erklärt. (Gestaltung mit CSS)

Viele Grüße,
Andreas

HaWe
02.12.2017, 14:39
CSS sagt mir gar nichts, und verstehen tu ich es auch nicht, wie das gehen soll.

Die Farbe habe ich jetzt immerhin hinbekommen, per
script+= " <td bgcolor='yellow'> aktuellerString </td>";

nur die schwarzen Rahmen fehlen leider noch


--------------------------
edit:
habe auch das hinbekommen, per:

script+= "<table border=4 cellpadding=4>"; // statt "<table>";