You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Format-Table left aligns header for right aligned column #7078
Name Value
---------
PSVersion 6.1.0-preview.3
PSEdition Core
GitCommitId v6.1.0-preview.3
OS Microsoft Windows 10.0.16299
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This does not happen on Windows PowerShell 5.1 or pwsh 6.0.2.
changed the title [-]FormatTable left aligns header for right aligned column[/-][+]Format-Table left aligns header for right aligned column[/+]on Jun 15, 2018
I think the problem only manifest when the right aligned item is the last column. In an effort to get rid of the padding at the end of the row, I think we might have gotten rid of the right-alignment padding.
Activity
[-]FormatTable left aligns header for right aligned column[/-][+]Format-Table left aligns header for right aligned column[/+]powercode commentedon Jun 18, 2018
I think the problem only manifest when the right aligned item is the last column. In an effort to get rid of the padding at the end of the row, I think we might have gotten rid of the right-alignment padding.
Steve Lee (@SteveL-MSFT) Do you recognize any of this from your table formatting changes?
I think
addPaddingherePowerShell/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs
Line 243 in 9ac701d
should only be set if we are not right aligned.
SteveL-MSFT commentedon Jun 18, 2018
Staffan Gustafsson (@powercode) I think you're right. Ilya (@iSazonov) and I added more tests to Format-Table.Tests.ps1, but it looks like we missed cases where the header is shorter than the width.
Are you planning on submitting a PR?
powercode commentedon Jun 18, 2018
I have other things I should catch up with first, but I think we should fix this before releasing.
SteveL-MSFT commentedon Jun 18, 2018
Staffan Gustafsson (@powercode) no problem, I'll see about looking at this after my current PRs, just didn't want to work on it if you were going to.