Markdown Table
In Markdown, tables are created using |
to separate different cells and -
to separate the header from other rows.
The syntax format is as follows:
| Header | Header |
| ------ | ------ |
| Cell | Cell |
| Cell | Cell |
The above code displays the following result:
Alignment
We can set the alignment of the table:
-:
sets content and header to right alignment.:-
sets content and header to left alignment.:-:
sets content and header to center alignment.
Here is an example:
| Left Aligned | Right Aligned | Centered |
| :----------- | ------------: | :------: |
| Cell | Cell | Cell |
| Cell | Cell | Cell |
The above code displays the following result: