File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 31
31
'Country' ,
32
32
'2025 Population' ,
33
33
'Area (M km^2)' ,
34
- 'Density (/km^2)' ,
34
+ 'Population Density (/km^2)' ,
35
35
'GDP (million US$)' ,
36
36
'GDP per capita (US$)' ,
37
37
]
@@ -101,6 +101,18 @@ def do_countries(self, _: cmd2.Statement) -> None:
101
101
str_row = [f"{ item :,} " if isinstance (item , int ) else str (item ) for item in row ]
102
102
table .add_row (* str_row )
103
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
+
104
116
self .poutput (table )
105
117
106
118
You can’t perform that action at this time.
0 commit comments