Skip to content

Commit e4096cb

Browse files
committed
Ignore last column padding only when aligned left
1 parent b72dfa4 commit e4096cb

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

encode.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ func (enc *TableEncoder) row(vals []*Value, rs rowStyle) {
498498
width += v.Width
499499
}
500500
padding := enc.maxWidths[i] - width
501-
// no padding for last cell if no border
502-
if enc.border <= 1 && i == len(vals)-1 && (!rs.hasWrapping || l >= len(v.Newlines)) {
501+
// no padding for last cell if no border and aligned left
502+
if enc.border <= 1 && v.Align == AlignLeft && i == len(vals)-1 && (!rs.hasWrapping || l >= len(v.Newlines)) {
503503
padding = 0
504504
}
505505
enc.writeAligned(v.Buf[start:end], rs.filler, v.Align, padding)

testdata/big.gz

46 Bytes
Binary file not shown.

testdata/multi.gz

24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)