|
|||
Quellcoder einer Tabelle automatisiert säubern?
Guten Abend zusammen,
stelle im Moment eine Tabelle zusammen, in der ich ein paar Sachen vergleichen möchte. Die Tabelle würde im am Ende gerne mit Libre Office Calc zu (x)html Exportieren. Das Ergebnis ist dann leider sehr voll gestopft mit unzählichen Klassen. All das brauche ich nicht und möchte nur die (x)html Tabelle mit dem Inhalt haben. Das bringt mich zu der Frage, ob man das Ergebnis von Calc durch ein Script, Website oder ähnliches säubern kann? Denn ich brauche es nur so einfach wie ich es mal selbst als "Muster" erstellt habe: HTML-Code:
<table> <tbody> <tr> <th scope="col" rowspan="2">Firma</th> <th scope="col" rowspan="2">Model</th> <th scope="col" rowspan="2">Karten</th> <th scope="col" colspan="4">Navigation</th> <th scope="col" colspan="3">Bedienung</th> <th scope="col" colspan="2">Akku</th> <th scope="col" colspan="4">Maße</th> <th scope="col" colspan="2">Speicher</th> </tr> <tr> <td>zu Fuß</td> <td>Rad</td> <td>Auto</td> <td>Sprache</td> <td>Tasten</td> <td>Touch-Screen</td> <td>Sprache</td> <td>Laufzeit</td> <td>Art</td> <td>Breite</td> <td>Höhe</td> <td>Tiefe</td> <td>Gewicht</td> <td>Art</td> <td>Größe</td> </tr> <tr> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> </tr> <tr> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> <td>x</td> </tr> </tbody> </table> Lieben Gruß Tobias |
Sponsored Links |
|
|||
Nachtrag
Der vollgestopfte Quellcode schaut so aus:
HTML-Code:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!--This file was converted to xhtml by OpenOffice.org - see http://xml.openoffice.org/odf2xhtml for more info.--><head profile="http://dublincore.org/documents/dcmi-terms/"><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/><title xml:lang="en-US">- no title specified</title><meta name="DCTERMS.title" content="" xml:lang="en-US"/><meta name="DCTERMS.language" content="en-US" scheme="DCTERMS.RFC4646"/><meta name="DCTERMS.source" content="http://xml.openoffice.org/odf2xhtml"/><meta name="DCTERMS.issued" content="2011-07-07T10:38:18.39" scheme="DCTERMS.W3CDTF"/><meta name="DCTERMS.modified" content="2011-07-07T12:48:57.29" scheme="DCTERMS.W3CDTF"/><meta name="DCTERMS.provenance" content="" xml:lang="en-US"/><meta name="DCTERMS.subject" content="," xml:lang="en-US"/><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en"/><link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en"/><link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en"/><link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en"/><base href="."/><style type="text/css"> @page { } table { border-collapse:collapse; border-spacing:0; empty-cells:show } td, th { vertical-align:top; font-size:10pt;} h1, h2, h3, h4, h5, h6 { clear:both } ol, ul { margin:0; padding:0;} li { list-style: none; margin:0; padding:0;} <!-- "li span.odfLiEnd" - IE 7 issue--> li span. { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; } span.footnodeNumber { padding-right:1em; } span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; } * { margin:0;} .ta1 { writing-mode:lr-tb; } .Default { font-family:Arial; } .ce1 { font-family:Arial; border-bottom-width:0.088cm; border-bottom-style:solid; border-bottom-color:#000000; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .ce10 { font-family:Arial; border-bottom-width:0.088cm; border-bottom-style:solid; border-bottom-color:#000000; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:12pt; font-weight:bold; } .ce11 { font-family:Arial; border-width:0.0133cm; border-style:solid; border-color:#000000; } .ce12 { font-family:Arial; } .ce13 { font-family:Arial; border-bottom-style:none; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .ce14 { font-family:Arial; border-bottom-width:0.088cm; border-bottom-style:solid; border-bottom-color:#000000; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:12pt; font-weight:bold; } .ce15 { font-family:Arial; border-width:0.0133cm; border-style:solid; border-color:#000000; } .ce16 { font-family:Arial; } .ce17 { font-family:Arial; border-bottom-style:none; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .ce18 { font-family:Arial; border-bottom-width:0.088cm; border-bottom-style:solid; border-bottom-color:#000000; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:12pt; font-weight:bold; } .ce19 { font-family:Arial; border-width:0.0133cm; border-style:solid; border-color:#000000; } .ce2 { font-family:Arial; border-bottom-width:0.088cm; border-bottom-style:solid; border-bottom-color:#000000; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:12pt; font-weight:bold; } .ce20 { font-family:Arial; } .ce21 { font-family:Arial; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .ce22 { font-family:Arial; vertical-align:middle; text-align:center ! important; font-size:12pt; font-weight:bold; } .ce3 { font-family:Arial; border-width:0.0133cm; border-style:solid; border-color:#000000; } .ce4 { font-family:Arial; border-bottom-style:none; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .ce5 { font-family:Arial; border-bottom-style:none; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .ce6 { font-family:Arial; border-bottom-width:0.088cm; border-bottom-style:solid; border-bottom-color:#000000; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:12pt; font-weight:bold; } .ce7 { font-family:Arial; border-width:0.0133cm; border-style:solid; border-color:#000000; } .ce8 { font-family:Arial; } .ce9 { font-family:Arial; border-bottom-style:none; border-left-width:0.088cm; border-left-style:solid; border-left-color:#000000; border-right-width:0.088cm; border-right-style:solid; border-right-color:#000000; border-top-style:none; vertical-align:middle; text-align:center ! important; font-size:14pt; font-weight:bold; } .co1 { width:3cm; } .co2 { width:2cm; } .co3 { width:2.267cm; } .ro1 { height:0.647cm; } .ro2 { height:1.053cm; } .ro3 { height:0.478cm; } <!-- ODF styles with no properties representable as CSS --> { } </style></head><body dir="ltr" style="max-width:42cm;margin-top:1cm; margin-bottom:1cm; margin-left:1cm; margin-right:1cm; "><table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="131"/><col width="131"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="87"/><col width="99"/></colgroup><tr class="ro1"><td rowspan="2" style="text-align:left;width:3cm; " class="ce1"><p>Firma</p></td><td rowspan="2" style="text-align:left;width:3cm; " class="ce1"><p>Model</p></td><td rowspan="2" style="text-align:left;width:2cm; " class="ce1"><p>Karten</p></td><td colspan="4" style="text-align:left;width:2cm; " class="ce4"><p>Navigation</p></td><td colspan="3" style="text-align:left;width:2cm; " class="ce4"><p>Bedienung</p></td><td colspan="2" style="text-align:left;width:2cm; " class="ce5"><p>Akku</p></td><td colspan="4" style="text-align:left;width:2cm; " class="ce9"><p>Maße</p></td><td colspan="2" style="text-align:left;width:2cm; " class="ce4"><p>Speicher</p></td><td style="text-align:left;width:2.267cm; " class="ce21">*</td></tr><tr class="ro2"><td style="text-align:left;width:2cm; " class="ce2"><p>zu Fuß</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Rad</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Auto</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Sprache</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Tasten</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Touch-screen</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Sprache</p></td><td style="text-align:left;width:2cm; " class="ce6"><p>Laufzeit</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Art</p></td><td style="text-align:left;width:2cm; " class="ce10"><p>Breite</p></td><td style="text-align:left;width:2cm; " class="ce10"><p>Höhe</p></td><td style="text-align:left;width:2cm; " class="ce10"><p>Tiefe</p></td><td style="text-align:left;width:2cm; " class="ce14"><p>Gewicht</p></td><td style="text-align:left;width:2cm; " class="ce2"><p>Art</p></td><td style="text-align:left;width:2cm; " class="ce18"><p>Größe</p></td><td style="text-align:left;width:2.267cm; " class="ce22">*</td></tr><tr class="ro3"><td style="text-align:left;width:3cm; " class="ce3"><p>Test</p></td><td style="text-align:left;width:3cm; " class="ce3"><p>Test</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:right; width:2cm; " class="ce7"><p>0,00Std</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>x</p></td><td style="text-align:right; width:2cm; " class="ce11"><p>0,00cm</p></td><td style="text-align:right; width:2cm; " class="ce11"><p>0,00cm</p></td><td style="text-align:right; width:2cm; " class="ce11"><p>0,00cm</p></td><td style="text-align:right; width:2cm; " class="ce15"><p>0,00kg</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Unbekannt</p></td><td style="text-align:right; width:2cm; " class="ce19"><p>0,00MB</p></td><td style="text-align:left;width:2.267cm; " class="Default">*</td></tr><tr class="ro3"><td style="text-align:left;width:3cm; " class="ce3"><p>Test 2</p></td><td style="text-align:left;width:3cm; " class="ce3"><p>Test 2</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Raster</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Ja</p></td><td style="text-align:right; width:2cm; " class="ce7"><p>1,00Std</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>y</p></td><td style="text-align:right; width:2cm; " class="ce11"><p>1,00cm</p></td><td style="text-align:right; width:2cm; " class="ce11"><p>1,00cm</p></td><td style="text-align:right; width:2cm; " class="ce11"><p>1,00cm</p></td><td style="text-align:right; width:2cm; " class="ce15"><p>1,00kg</p></td><td style="text-align:left;width:2cm; " class="ce3"><p>Extern</p></td><td style="text-align:right; width:2cm; " class="ce19"><p>1,00MB</p></td><td style="text-align:left;width:2.267cm; " class="Default">*</td></tr></table></body></html> |
Sponsored Links |
|
|||
Hi, ich benutze Scriply zum schreiben von Webseiten, dort ist es möglich einfache Scripte (suchen u. ersetzen) zu erstellen. Es gibt schon fertige suchen u. ersetzen Scripte die als Vorlage dienen könnten.
MfG |
|
|||
Hallo,
kenne bis lang nur die normale Suchen&Ersetzen Funktion, wie sie auch ein Editor hat, doch auch ein Script bringt mich da leider nicht weiter, denke ich. Denn bei der Exportierten Calc Tabelle ist zum Beispiel die Bezeichnun für eine Klasse zwar ähnlich, aber immer durch eine Zahl ergänzt. Somit müsste das Script dann mit Platzhaltern arbeiten können. Kann es dann? Lieben Gruß Tobias |
|
|||
Wie wäre es den wenn du die Tabelle markierst und dann kopierst.
bekommst du folgende Werte Zitat:
|
|
|||
Guten Tag zusammen,
wie sollte es denn funktionieren, wenn ich den Tabellen Inhalt als Text habe - bei sehr vielen Zeilen wäre es auch dann noch sehr viel Arbeit, wenn ich die td und tr Elemente reinkopieren müsste. PHP läuft auf dem Server, jedoch möchte ich am Ende die Tabelle einfach in mein Blog einfügen. Wobei ich im Zweifelsfall dann auch einen iFrame nutzen könnte. Hintergrund ist, das ich in der Tabelle GPS-Geräte vergleichen möchte, um eines zu finden, welches zu mir passt und somit auch mit nicht so fitten Gelenken nutzbar ist. Da man mit Calc die Tabelle leicht erstellen kann, die Einträge dann verschiedenst sortieren kann und auch Diagramme erstellen kann, nutze ich dies. Um andere daran teilhaben zulassen, möchte ich die Tabelle eben in mein Blog stellen. LG Tobias |
|
|||
Du kannst im Libre-/OpenOffice die Datei als .csv speichern (unter anderem Dateinamen, gibt leider offenbar keinen Standard-Export-Filter dafür) und aus diesen Inhalten dann per Script die HTML-Tabelle generieren.
Das liefert dir dann beispielsweise: Code:
"Rang","Verein","Sp.","G","U","V","Tore","Diff.","Punkte" 1,"Borussia Dortmund",34,23,6,5,"67:22",45,75 2,"Bayer 04 Leverkusen",34,20,8,6,"64:44",20,68 3,"FC Bayern München (M/P)",34,19,8,7,"81:40",41,65 4,"Hannover 96",34,19,3,12,"49:45",4,60 5,"1. FSV Mainz 05",34,18,4,12,"52:39",13,58 6,"1. FC Nürnberg",34,13,8,13,"47:45",2,47 7,"1. FC Kaiserslautern (N)",34,13,7,14,"48:51",-3,46 8,"Hamburger SV",34,12,9,13,"46:52",-6,45 9,"SC Freiburg",34,13,5,16,"41:50",-9,44 10,"1. FC Köln",34,13,5,16,"47:62",-15,44 11,"TSG 1899 Hoffenheim",34,11,10,13,"50:50",0,43 12,"VfB Stuttgart",34,12,6,16,"60:59",1,42 13,"Werder Bremen",34,10,11,13,"47:61",-14,41 14,"FC Schalke 04",34,11,7,16,"38:44",-6,40 15,"VfL Wolfsburg",34,9,11,14,"43:48",-5,38 16,"Borussia Mönchengladbach",34,10,6,18,"48:65",-17,36 17,"Eintracht Frankfurt",34,9,7,18,"31:49",-18,34 18,"FC St. Pauli (N)",34,8,5,21,"35:68",-33,29 Da kannst du dann ein PHP-Script dranstöpseln: PHP-Code:
Code:
<table> <tr> <th>Rang</th> <th>Verein</th> <th>Sp.</th> <th>G</th> <th>U</th> <th>V</th> <th>Tore</th> <th>Diff.</th> <th>Punkte</th> </tr> <tr> <td>1</td> <td>Borussia Dortmund</td> <td>34</td> <td>23</td> <td>6</td> <td>5</td> <td>67:22</td> <td>45</td> <td>75</td> </tr> <tr> <td>2</td> <td>Bayer 04 Leverkusen</td> <td>34</td> <td>20</td> <td>8</td> <td>6</td> <td>64:44</td> <td>20</td> <td>68</td> </tr> <tr> <td>3</td> <td>FC Bayern München (M/P)</td> <td>34</td> <td>19</td> <td>8</td> <td>7</td> <td>81:40</td> <td>41</td> <td>65</td> </tr> <tr> <td>4</td> <td>Hannover 96</td> <td>34</td> <td>19</td> <td>3</td> <td>12</td> <td>49:45</td> <td>4</td> <td>60</td> </tr> <tr> <td>5</td> <td>1. FSV Mainz 05</td> <td>34</td> <td>18</td> <td>4</td> <td>12</td> <td>52:39</td> <td>13</td> <td>58</td> </tr> <tr> <td>6</td> <td>1. FC Nürnberg</td> <td>34</td> <td>13</td> <td>8</td> <td>13</td> <td>47:45</td> <td>2</td> <td>47</td> </tr> <tr> <td>7</td> <td>1. FC Kaiserslautern (N)</td> <td>34</td> <td>13</td> <td>7</td> <td>14</td> <td>48:51</td> <td>-3</td> <td>46</td> </tr> <tr> <td>8</td> <td>Hamburger SV</td> <td>34</td> <td>12</td> <td>9</td> <td>13</td> <td>46:52</td> <td>-6</td> <td>45</td> </tr> <tr> <td>9</td> <td>SC Freiburg</td> <td>34</td> <td>13</td> <td>5</td> <td>16</td> <td>41:50</td> <td>-9</td> <td>44</td> </tr> <tr> <td>10</td> <td>1. FC Köln</td> <td>34</td> <td>13</td> <td>5</td> <td>16</td> <td>47:62</td> <td>-15</td> <td>44</td> </tr> <tr> <td>11</td> <td>TSG 1899 Hoffenheim</td> <td>34</td> <td>11</td> <td>10</td> <td>13</td> <td>50:50</td> <td>0</td> <td>43</td> </tr> <tr> <td>12</td> <td>VfB Stuttgart</td> <td>34</td> <td>12</td> <td>6</td> <td>16</td> <td>60:59</td> <td>1</td> <td>42</td> </tr> <tr> <td>13</td> <td>Werder Bremen</td> <td>34</td> <td>10</td> <td>11</td> <td>13</td> <td>47:61</td> <td>-14</td> <td>41</td> </tr> <tr> <td>14</td> <td>FC Schalke 04</td> <td>34</td> <td>11</td> <td>7</td> <td>16</td> <td>38:44</td> <td>-6</td> <td>40</td> </tr> <tr> <td>15</td> <td>VfL Wolfsburg</td> <td>34</td> <td>9</td> <td>11</td> <td>14</td> <td>43:48</td> <td>-5</td> <td>38</td> </tr> <tr> <td>16</td> <td>Borussia Mönchengladbach</td> <td>34</td> <td>10</td> <td>6</td> <td>18</td> <td>48:65</td> <td>-17</td> <td>36</td> </tr> <tr> <td>17</td> <td>Eintracht Frankfurt</td> <td>34</td> <td>9</td> <td>7</td> <td>18</td> <td>31:49</td> <td>-18</td> <td>34</td> </tr> <tr> <td>18</td> <td>FC St. Pauli (N)</td> <td>34</td> <td>8</td> <td>5</td> <td>21</td> <td>35:68</td> <td>-33</td> <td>29</td> </tr> </table> |
|
|||
edith:// Die Lösung von mermshaus scheint die bessere zu sein. Das unten wäre zwar denkbar, aber wohl bei der Größenordnung etwas zu komplex.
Zitat:
|
Sponsored Links |
Stichwörter |
calc export, säubern, schlanker quellcode, tabelle |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
IE6: Inhalte bei großer Tabelle verschwunden | C-rank | CSS | 3 | 05.01.2008 13:23 |
Tabelle erscheint innerhalb eines DIVs | FBI | CSS | 1 | 27.06.2007 01:39 |
Tabelle height 100% im IE | paule | CSS | 0 | 09.05.2007 12:27 |
Mysql: Tabelle Ordnen, nach Integer Werten (timestamp) oder Zeitformaten? | braindead | Serveradministration und serverseitige Scripte | 8 | 14.03.2007 20:21 |
FF: Tabelle in Tabelle centern | wuschba | CSS | 2 | 20.07.2006 10:00 |