Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Erstellung einer HTML Tabelle im Body einer Email

$
0
0

Hallo zusammen,

ich habe folgendes script:

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "H2 {font-size:16px; font-weight: bold; font-family: sans-serif;}"
$style = $style + "</style>"

$body = ""

$body += $Vari1 +  "FEHLER abc<br>"
$body += $Vari2 + "FEHLER xyz<br>"

$body = ConvertTo-HTML -Body $body -Head $style | Out-String

Es wird ein Body im HTML-Stil erstellt. Jedoch wird keine Tabelle erstellt, sondern nur die Zeilen ausgegeben. Am Ende des Bodys sind diese Tags zu sehen:

<table> </table> </body></html>   

Scheinbar werden die Werte nicht vom TAg <table> </table> umschlossen.

Hat jemand einen Tipp wie die Tabelle die Zeilen aufnimmt?
In die erste Spalte so die vari und der Text in die zweite Spalte.

Gruß

Frank


Viewing all articles
Browse latest Browse all 2314


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>