1.

Markdown Tables

Answer»
  • We can create a markdown table with the HTML <table></table> tags without headers.
    • Example

<table>
<tr>
<td>
First Entry
</td>
<td>
Second Entry
</td>
<td>
Third Entry
</td>
</tr>
</table>

Output:

First EntrySecond EntryThird Entry
  • We can align the values of the columns of the table left, right and centre using :--: symbols.
    • Example:

In the example, the text in the columns will get aligned to the side where we put the : symbol. If the : is put on both sides, the text will be centre aligned. No alignment appears the same as left align.

| No Align | Right Align | Left Align | Center Align |
| -------- | -----------:|:---------- |:------------:|
| 1 | 1 | 1 | 1 |
| 11 | 11 | 11 | 11 |
| 111 | 111 | 111 | 111 |
| 1111 | 1111 | 1111 | 1111 |

Output:

No Align

Right Align

Left Align

Center Align

1

1

1

1

11

11

11

11

111

111

111

111

1111

1111

1111

1111

  • We can also build a table with multiple lines using the HTML <br> tag. It is to be noted that the <br> tag can also be used outside of tables for moving to a new line.
    • Example:

In this example, the use of the <br> tag is shown to build a table with multiple lines in a column.

| Column 1 | Column 2 | Column 3 |
|:--------:|:--------:|:---------------:|
| A | B | C <br> D <br> E |

Output:

Column 1 Column 2 Column 3
AB

C


D


E





Discussion

No Comment Found