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

AnsiTextCell and alignment #147

Open
thchr opened this issue Oct 5, 2021 · 3 comments
Open

AnsiTextCell and alignment #147

thchr opened this issue Oct 5, 2021 · 3 comments

Comments

@thchr
Copy link
Contributor

thchr commented Oct 5, 2021

I was expecting that AnsiTextCell would behave somewhat like a "minipage" in LaTeX: i.e. effectively as a rectangular box that is plugged in as an element of the table and isn't affected by alignment in the table itself.
Currently, however, the content of AnsiTextCell follows the alignment of the table itself, i.e.:
image

I had hoped that every alignment would've not affected the display of each AnsiTextCell. With the current behavior, for wanting AnsiTextCell to print "as-is" relative to its text-representation, one must use alignment = :l or manually ensure that each line in the AnsiTextCell is equally long.

@ronisbr
Copy link
Owner

ronisbr commented Oct 5, 2021

Hi @thchr

I see. Actually AnsiTextCell is a customized cell. Each line is treated as a line in a cell. That's why you are seeing this type of behavior.

I really do not want to change this behavior just for AnsiTextCell since every customized cell is handled generically inside PrettyTables.jl. However, we can add an option when creating AnsiTextCell to force every line to have the same length by appending spaces. Will it be enough?

@thchr
Copy link
Contributor Author

thchr commented Oct 5, 2021

Ah, I see; that's my misunderstanding then.

If there were an option to append spaces automatically to "fill out" short lines, that would indeed be enough and would suit my purposes perfectly!

@ronisbr
Copy link
Owner

ronisbr commented Oct 5, 2021

Nice! I will do it!

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