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 3131 'Country' ,
3232 '2025 Population' ,
3333 'Area (M km^2)' ,
34- 'Density (/km^2)' ,
34+ 'Population Density (/km^2)' ,
3535 'GDP (million US$)' ,
3636 'GDP per capita (US$)' ,
3737]
@@ -101,6 +101,18 @@ def do_countries(self, _: cmd2.Statement) -> None:
101101 str_row = [f"{ item :,} " if isinstance (item , int ) else str (item ) for item in row ]
102102 table .add_row (* str_row )
103103
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+
104116 self .poutput (table )
105117
106118
You can’t perform that action at this time.
0 commit comments