Skip to content

Table Styling and Formatting should work for non-js use cases #300

Open
@jojiklmts

Description

@jojiklmts

I have issues related to formatting:

  1. Custom column widths. As you can see I am trying to set column width to 50 but whatever number I put in, nothing changes
  2. Custom font size. I am trying to set the font size to 12 but it keeps being 8
  3. Would like to define font info / formatting only once per whole HTML object and not multiple times.
    I tried to use New-HTMLTableStyle with hopes that I could set my fonts for whole table in one place but it does not work and I have to set the fonts by using New-HTMLTableHeader and New-HTMLTableContent. That way I can actually set the font type but custom font size never works.
$UniqueRecipients | ForEach-Object {
        $Mail = $_
        # Construct HTML object
        $EmailTable = $Table | Where-Object {$_.Mail -eq $Mail}
        $Html = New-HTML {           
            New-HTMLText -Text "Your server(s) just started patching." -FontFamily 'Calibri' -FontStyle 'normal' -FontSize 12            
            New-HTMLTable -DataTable $EmailTable -HideFooter {
                New-HTMLTableStyle -Type Table -FontFamily 'Calibri' -FontStyle 'normal' -FontSize 12
                New-HTMLTableColumnOption -AllColumns -Width 50
                New-HTMLTableHeader -Names ServerFQDN,PatchingStartDateTime,SkipXmonths,UtcOffset -FontFamily 'Calibri' -FontStyle 'normal' -FontSize 12
                New-HTMLTableContent -ColumnIndex 1,2,3,4 -FontFamily 'Calibri' -FontStyle 'normal' -FontSize 12
            }
        }        
       Send-MailMessage -From "[email protected]" -To $Mail -Subject "OnDemand Patching - Startup notification" -Body $Html -SmtpServer smtp.server.com -Credential $Creds -BodyAsHtml
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSSCSS relatedJSJavaScript relatedenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions