- Headings
- A table of contents
- Styling text
- Quoting text/Blockquotes
- Tables
- Basic formatting syntax from GitHub
- Basic Syntax with best and bad practices
To create a heading, add one to six # symbols before your heading text. The number of # you use will determine the size of the heading.
# The largest heading
## The second largest heading
###### The smallest heading
When you use two or more headings, GitHub automatically generates a table of contents which you can access by clicking within the file header. Each heading title is listed in the table of contents and you can click a title to navigate to the selected section.
Alternatively you could create it manually with links. This option is useful when:
- you work with readme not only via browser and GitHub.
- in the file you only refer to the sections from other readme files.
Example | Output |
---|---|
**Bold 1** |
Bold 1 |
__Bold 2__ |
Bold 2 |
*Italic 1* |
Italic 1 |
_Italic 2_ |
Italic 2 |
~~Strikethrough~~ |
|
~~`Strikethrough code`~~ |
Strikethrough code |
**Bold and _nested italic_** |
Bold and nested italic |
***All bold and italic*** |
All bold and italic |
<sub>This is a subscript text</sub> |
This is a subscript text |
<sup>This is a superscript text</sup> |
This is a superscript text |
Quoting text:
> Text that is a quote
Output:
Text that is a quote
Quoting code:
Wrap value with a single `: quoted code
Wrap multilines with ```:
cod line 1
code line 2
Strikethrough code wrap it with ~~`
and `~~
:
Strikethrough code
By including colons :
within the header row, you can define text to be left-aligned, right-aligned, or center-aligned:
| Left-Aligned | Center Aligned | Right Aligned |
|:-----------------------|:----------------------:|-----------------------:|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
| [tables link](#tables) | [tables link](#tables) | [tables link](#tables) |
Result:
Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
col 3 is | some wordy text | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
tables link | tables link | tables link |
Note: In IntelliJ IDEA, you get a warning, if you do not format the value itself with the right number of spaces. Just apply the quick fix for the whole table.