Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colors in nested tables not drawn correctly #15

Open
noorez opened this issue Jan 14, 2015 · 1 comment
Open

Colors in nested tables not drawn correctly #15

noorez opened this issue Jan 14, 2015 · 1 comment

Comments

@noorez
Copy link

noorez commented Jan 14, 2015

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"

@yardensachs
Copy link

Can this be resolved somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants