Markdown Tables
Markdown tables are a way to organize data in a structured format within a Markdown document. They consist of rows and columns, with each cell containing data. Tables in Markdown are created using a combination of vertical bars (|) and hyphens (-) to define the columns and rows, respectively. The first row typically contains the column headers, while subsequent rows contain the data. For example:
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
This code produces the following table:
Column 1 | Column 2 | Column 3 |
---|---|---|
Data 1 | Data 2 | Data 3 |
Data 4 | Data 5 | Data 6 |
- In Markdown, you can align the values of the columns of a table to the left, right, or center using the
:--:
,:--
, or--:
symbols, respectively. This is done by placing these symbols between the vertical bars (|
) in the table’s header row.
Example:
| Left-aligned | Center-aligned | Right-aligned |
|:-------------|:--------------:|--------------:|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
Output:
Left-aligned | Center-aligned | Right-aligned |
---|---|---|
Data 1 | Data 2 | Data 3 |
Data 4 | Data 5 | Data 6 |
- Additionally, you can build a table with multiple lines using the HTML <br> tag. This tag can be used within a cell to create line breaks, allowing you to display multi-line text in a single cell.
Example:
| Column 1 | Column 2 |
|----------|----------|
| Line 1 | Line 1 |
| Line 2 | Line 2 |
| Line 3 | Line 3 |
Output:
Column 1 | Column 2 |
---|---|
Line 1 | Line 1 |
Line 2 | Line 2 |
Line 3 | Line 3 |
Markdown Cheat Sheet
Markdown is a simple way to write and format text using plain text symbols. It’s a lightweight language that lets you create nicely formatted text without the use of complex coding. The idea is to make it easy for people to read and understand the formatting, even if they’re looking at the raw text.
This cheat sheet will go over some of the key components of markdown, including code syntaxes and examples that the reader can use to create their own highly formatted text articles.
Contact Us