'How to change text alignment in GitHub readme?
I'm editting my GitHub readme and I need to add text in two different alignments. Part of the readme is in English and should be left to right and another part is in a different language (Persian, in my case) which has a right to left alignment. Since GitHub editor does not have any setting to change the text alignment, I wonder if there's any other way to do this?
I've already tried HTML tags like <div dir="rtl">متن فارسی</div> to change the alignment but it doesn't work.
Edit
After getting feedback from @Quentin, I realized that the problem was that when you go to the Preview tab, you cannot see the changes, however, once you Commit, changes will be applied. So, <div dir="rtl">متن فارسی</div> does work, the only thing is that you will see changes after the commit, not in preview tab.
Solution 1:[1]
For a quick fix, I've just realized that <p align="right">text</p> works, but a lot of variations with divs and style within the tag did not.
Solution 2:[2]
Solution 3:[3]
Update Jan. 2022: GitHub editor supports RtL.
Original answer (Q1 2020)
This is followed by dear-github/dear-github issue 275
I think this support is also needed in markdown files, especially in ReadMe files.
Adding such support is very easy: just allow to add a tag "
dir='rtl'" at the beginning of a document, and then wrap the entire document inside a "div dir='rtl'".Also today it is possible to put all text inside a "
div dir='rtl'", but then it is not possible to use markdown inside.
So this is not yet supported (at least in the preview, as mentioned by the OP).
It seems to be applied once committed, as tested by Quentin.
There is a discussion on Mardown/Commonmark RTL support.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sylvia Pap |
| Solution 2 | VahidN |
| Solution 3 |



