Skip to content

Commit

Permalink
table: fix outdated docs and example on styling table (#176)
Browse files Browse the repository at this point in the history
* fix: outdated docs and example on styling table

added an example to style 1st columns using the new style `IndexCoumn` approach.

* table: simplify doc

Co-authored-by: Mohammed Sohail <sohailsameja@gmail.com>
  • Loading branch information
jedib0t and kamikazechaser committed Jul 11, 2021
1 parent dd7fc2a commit 71ae72a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions table/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ You can also roll your own style:
UnfinishedRow: " ~~~",
},
Color: table.ColorOptions{
AutoIndexColumn: nil,
FirstColumn: nil,
IndexColumn: text.Colors{text.BgCyan, text.FgBlack},
Footer: text.Colors{text.BgCyan, text.FgBlack},
Header: text.Colors{text.BgHiCyan, text.FgBlack},
Row: text.Colors{text.BgHiWhite, text.FgBlack},
Expand All @@ -187,6 +186,7 @@ Or you can use one of the ready-to-use Styles, and just make a few tweaks:
```golang
t.SetStyle(table.StyleLight)
t.Style().Color.Header = text.Colors{text.BgHiCyan, text.FgBlack}
t.Style().Color.IndexColumn = text.Colors{text.BgHiCyan, text.FgBlack}
t.Style().Format.Footer = text.FormatLower
t.Style().Options.DrawBorder = false
```
Expand Down

0 comments on commit 71ae72a

Please sign in to comment.