0

I have a table written in github flavored markdown. It is used in Github readme file for a repository.

I need to center the table horizontally, i tried to define align attribute in several tags (parented tags also), but that doesn't seems to take any effect on the alignment.

enter image description here

here's the code i used:

<h1 align="center"> <br> <table align="center"> <tr><td> <img src="./res/logo_static.png" width="200" alt="PasteMyst.Pas"> </td></tr> </table> </h1> 

logo_static is an image i kept in the same directory, also ignore the alt name used.

2
  • sorry but that doesn't have any effects on tables. Also mentioning, that i'm using github flavored markdown :) Commented Feb 12, 2021 at 17:01
  • 1
    Note that while the duplicate question Is it possible to have a table in the center in Github gist markdown? specifically mentions "gist" GitHub uses the same tools across all of their sites so the answer applies to GitHub.com as well. Commented Feb 12, 2021 at 21:10

1 Answer 1

1

.center { margin-left: auto; margin-right: auto; }
 <table class="center"> <tr> <td><img src="https://via.placeholder.com/150"></td> </tr> </table> 

Sign up to request clarification or add additional context in comments.

1 Comment

thank you for answering, that works pretty well in markdown, but i'm using it in a github readme.md file (github flavored markdown), because of which it is showing a very different behavior in github

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.