python-texttable icon indicating copy to clipboard operation
python-texttable copied to clipboard

Colors in nested tables not drawn correctly

Open noorez opened this issue 10 years ago • 1 comments

inner_table = Texttable() inner_table.add_row([get_color_string(bcolors.GREEN, "Name"), "Noorez"]) inner_table.draw() '+------+--------+\n| \x1b[92mName\x1b[0m | Noorez |\n+------+--------+'

the color maker is only on name

inner_table2 = Texttable() inner_table2.add_row([get_color_string(bcolors.RED, "Name"), "Kassam"]) inner_table2.draw() '+------+--------+\n| \x1b[91mName\x1b[0m | Kassam |\n+------+--------+'

as above the color marker is only on name

full_table.add_row([inner_table.draw()]) full_table.add_row([inner_table2.draw()]) full_table.draw() '+-------------------+\n| \x1b[92m+------+--------+\x1b[0m |\n| \x1b[92m| Name | Noorez |\x1b[0m |\n| \x1b[92m+------+--------+\x1b[0m |\n+-------------------+\n| \x1b[91m+------+--------+\x1b[0m |\n| \x1b[91m| Name | Kassam |\x1b[0m |\n| \x1b[91m+------+--------+\x1b[0m |\n+-------------------+'

notice how now the color marker is on the entire cell? This causes the entire inner table to be colored when it should have only been the string "Name"

noorez avatar Jan 14 '15 15:01 noorez

Can this be resolved somehow?

yardensachs avatar Jul 06 '17 18:07 yardensachs