Powershell Script of Sending an HTML Email Report in a Formatted Table

This is a re-post from Powershell expert “Ben Wilkinson“, the original ps function is here. I did have some trouble in making it work in my own script and found that I have to add opening and closing “style” tags in the css definition part to make it work. So here I am writing a memo about this:

[code language=”css”]
if (!$CSS)

{

# Please use the download link to get the CSS it may not display correctly here.

$CSS = @"

<style>

table {

font-family: Verdana;

border-style: dashed;

border-width: 1px;

border-color: #FF6600;

padding: 5px;

background-colo​r: #FFFFCC;

table-layout: auto;

text-align: center;

font-size: 8pt;

}

table th {

border-bottom-s​tyle: solid;

border-bottom-w​idth: 1px;

font: bold

}

table td {

border-top-styl​e: solid;

border-top-widt​h: 1px;

}

.style1 {

font-family: Courier New, Courier, monospace;

font-weight:bol​d;

font-size:small​;

}

</style>

"@

}#End if

[/code]


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *