Skip to content

Question: New-tableheader --> cell-border-style #184

Closed

Description

@paddy75

Hello,
is it possible to set a cell-border-style in new-tableheader? The same what you can do in excel? Then it is little bit easier to see which cells are belongs together. At the moment I set a background color to show this.
Here an example from excel what i mean
headers

Activity

  1. PrzemyslawKlys commented on Jan 15, 2021

    @PrzemyslawKlys
    Member

    It's not yet possible. But it could be done, with some effort.

  2. PrzemyslawKlys commented on Jan 16, 2021

    @PrzemyslawKlys
    Member

    Here's some new functionality in 0.0.130. But it's not exactly what you wanted, but maybe sufficient.

    $Table = Get-Process | Select-Object -First 3
    New-HTML -ShowHTML -HtmlData {
        New-HTMLTable -DataTable $table -HideButtons {
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Yellow -TextColor Aquamarine -TextAlign center -Type RowOdd
            New-HTMLTableStyle -BackgroundColor Red -TextColor Aquamarine -Type Button
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor DarkSlateGray -TextColor Aquamarine -TextAlign center -Type RowEven
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor DarkSlateGray -TextColor Aquamarine -TextAlign center -Type Row
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor DarkSlateGray -TextColor Aquamarine -TextAlign center -Type Header
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Orange -TextColor Aquamarine -TextAlign center -Type Footer
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Orange -TextColor Aquamarine -TextAlign center -Type RowSelectedEven
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Green -TextColor Aquamarine -TextAlign center -Type RowSelectedOdd
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Yellow -TextColor Aquamarine -TextAlign center -Type RowHover
            New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Red -TextColor Aquamarine -TextAlign center -Type RowHoverSelected
            New-HTMLTableStyle -Type Header -BorderLeftStyle dashed -BorderLeftColor Red -BorderLeftWidthSize 1px
            New-HTMLTableStyle -Type Footer -BorderLeftStyle dotted -BorderLeftColor Red -BorderleftWidthSize 1px
            New-HTMLTableStyle -Type Footer -BorderTopStyle none -BorderTopColor Red -BorderTopWidthSize 5px -BorderBottomColor Yellow -BorderBottomStyle solid
            New-HTMLTableStyle -Type Footer -BorderTopStyle none -BorderTopColor Red -BorderTopWidthSize 5px -BorderBottomColor Yellow -BorderBottomStyle solid
            New-HTMLTableStyle -Type Footer -BorderTopStyle none -BorderTopColor Red -BorderTopWidthSize 5px -BorderBottomColor Yellow -BorderBottomStyle none
        } -DisablePaging
    } -FilePath $PSScriptRoot\Example7_TableStyle.html -Online

    It should now work fine with the new version. I've also added multiple other customization options.

  3. paddy75 commented on Jan 17, 2021

    @paddy75
    Author

    Wow, goooood job. Looks good for the first tries.
    3 problems what i see at the moment.

    1. i made a new-htmltablestyle in new-htmltable but is is applied to all tables (here i tried to apply it only on the second table)
    2. -borderbottomstyle seems to be not visible correctly, when before the real table starts
    3. border right is set for column 1, border left is set for column 2. in the middle you have the double size then
      2021-01-17 17_44_10-192 168 179 43 - Remotedesktopverbindung

    i still playing around a little

  4. PrzemyslawKlys commented on Jun 23, 2026

    @PrzemyslawKlys
    Member

    Closed by PR #525, which added table header border styling options and covered them in regression tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions