We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8090ee4 commit a821cb0Copy full SHA for a821cb0
1 file changed
examples/rich_tables.py
@@ -31,7 +31,7 @@
31
'Country',
32
'2025 Population',
33
'Area (M km^2)',
34
- 'Density (/km^2)',
+ 'Population Density (/km^2)',
35
'GDP (million US$)',
36
'GDP per capita (US$)',
37
]
@@ -101,6 +101,18 @@ def do_countries(self, _: cmd2.Statement) -> None:
101
str_row = [f"{item:,}" if isinstance(item, int) else str(item) for item in row]
102
table.add_row(*str_row)
103
104
+ # Make Population column blue
105
+ table.columns[2].header_style = "bold blue"
106
+ table.columns[2].style = "blue"
107
+
108
+ # Make Density column red
109
+ table.columns[4].header_style = "bold red"
110
+ table.columns[4].style = "red"
111
112
+ # Make GDB per capita column green
113
+ table.columns[6].header_style = "bold green"
114
+ table.columns[6].style = "green"
115
116
self.poutput(table)
117
118
0 commit comments