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

Only center alignment of markdown table #104

Open
arthur-thuy opened this issue Jan 27, 2024 · 0 comments
Open

Only center alignment of markdown table #104

arthur-thuy opened this issue Jan 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@arthur-thuy
Copy link

Describe the bug
The align parameter in functions such as new_paragraph has no effect on tables.

To Reproduce

All three tables printed below are center-aligned. This is not the desired behavior.

import subprocess

from mdutils.mdutils import MdUtils
from mdutils import Html
import pandas as pd

mdFile = MdUtils(file_name="Example_Markdown", title="Markdown File Example")

mdFile.new_header(level=1, title="Overview")  # style is set 'atx' format by default.

d = {"col1": [1, 2], "col2": [3, 4]}
df = pd.DataFrame(data=d)
mdFile.new_paragraph(df.to_markdown(index=False))
mdFile.new_paragraph()
mdFile.new_paragraph(df.to_markdown(index=False), align="center")
mdFile.new_paragraph()
mdFile.new_paragraph(df.to_markdown(index=False), align="left")
mdFile.create_md_file()
subprocess.run(
    "pandoc Example_Markdown.md -o Example_Markdown.pdf",
    shell=True,
    check=False,
)

Expected behavior
I expect left alignment with align="left". I'm not sure what the behavior for the default parameter "" should be.

Screenshots
/

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Version: mdutils 1.6.0

Additional context
/

@arthur-thuy arthur-thuy added the bug Something isn't working label Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant