left, right, and center-aligned Markdown tables
I realize that Markdown is a mess, but for tablefmt="github" with stralign argument, the header line (which goes as -----------) can be modified as the following:
-
stralign="left": header lines will have:---------. -
stralign="right": header lines will have---------:. -
stralign="center": header lines have:--------:.
I just had a look at implementing this and realised that this is exactly what the 'pipe' format does. The README even points out that the 'github' format is the 'pipe' format without alignment markers, although I missed that the first time I read through the patterns.
Had the same issue trying to produce a GitHub table with alignment directives. I ended up with a workaround to emulate that behavior. For reference, my hackish code is available at: https://github.com/kdeldycke/meta-package-manager/blob/af261b7194c592bbd45a6910bed8063fa6c59fbe/meta_package_manager/inventory.py#L56-L87
For reference, I proposed a PR to address this issue at: https://github.com/astanin/python-tabulate/pull/261