Closed lamyergeier closed 3 months ago
Hello, thank you for the issue.
Columns are not aligned. Both, center and right alignment are not working.
What do you mean by that? As I can see, output contains right align colons in the header row. Can you please add expected output for this case?
Standardized input to option: -C option takes values like comma-separated list of column indices or ranges, may be similar syntax can be used for
-r
and-c
.
You're right, it looks a bit inconsistent. But in my opinion, it's better to support multiple values for -C
as it's done for -r
and -c
. Feel free to create PR with improvement.
Also if
-r
and-c
is used with-C
then the colmnn number for-r
and-c
should not be the affected by-C
but original column number. Currently this is not the case!
I'm not sure if this is more expected behavior than the current ones. Can you please add some arguments for the proposed logic? Anyway, comments should be added to the flags.
What do you mean by that? As I can see, output contains right align colons in the header row. Can you please add expected output for this case?
| a | b | c | d |
|:------------|------:|------------|----:|
| handwritten | 200 | 2024-04-29 | 36 |
| youtube | 10000 | 2024-04-29 | 21 |
| firefox | 5000 | 2024-04-29 | 39 |
| epub | 1000 | 2024-04-29 | 49 |
| android | 10000 | 2024-04-29 | 179 |
Sorry, but this it not the right output:
a
should be centered due to -c 0
;b
and d
should not be aligned with spaces. Column alignment managed within the header row.@lzakharov Your point 1 is correct. I made a mistake in the desired output. It should be as follows
| a | b | c | d |
|:-----------:|------:|------------|----:|
| handwritten | 200 | 2024-04-29 | 36 |
| youtube | 10000 | 2024-04-29 | 21 |
| firefox | 5000 | 2024-04-29 | 39 |
| epub | 1000 | 2024-04-29 | 49 |
| android | 10000 | 2024-04-29 | 179 |
as you can see that column with headers a, b, d are all aligned with spaces (which you clarified in second point of yours, that this is not desirable).
There is no need to align columns with spaces - alignment must be done when rendering the markdown.
If you want to have tables in such format, you can try to configure additional markdown formatter. But I'm still not sure that anyone uses and supports such a format.
@lamyergeier you can try https://github.com/astanin/python-tabulate -- it's pretty good at handling different types of markdown formats.
Sample Data
Convert to Markdown
Issues
-r
and-c
.-r
and-c
is used with-C
then the colmnn number for-r
and-c
should not be the affected by-C
but original column number. Currently this is not the case!