Markdown in Slack
Slack is an instant messaging application. It is a one-to-one and team collaboration using channels. Markdown in Slack is not supported but can be used in messages and posts on Slack
Users of Slack support plain text messages
Slack can be customized Create a channel Custom app creation
Slack does not support markdown, But it supports its syntax language called markdown
Markdown in Slack is used in messages and posts.
Support markdown features in Slack messages
Does Slack support markdown tables?
Tables containers rows columns and headers, can be created using the Pipe operator !
and dash symbols -
. Headers are created using a minimum of three hyphens, Columns of data or headers can be separated by the pipe symbol.
here is a table syntax
|Header1 |Header2 | Header3|
|--- | --- | ---|
|data1|data2|data3|
|data11|data12|data13|
following is generated HTML code
<table>
<thead>
<tr>
<th>Header1</th>
<th>Header2</th>
<th>Header3</th>
</tr>
</thead>
<tbody>
<tr>
<td>data1</td>
<td>data2</td>
<td>data3</td>
</tr>
<tr>
<td>data11</td>
<td>data12</td>
<td>data13</td>
</tr>
</tbody>
</table>
Output generated in the browser is
Header1 | Header2 | Header3 |
---|---|---|
data1 data2 | data3 | |
data11 | data12 | data13 |
Some of the rules of markdown tables
- Headers are separated by pipes
- tables without header not supported in core specification
- A minimum of 3 dashes under each header name is required, can declare more than three dashes
- Pipes symbol is optional, but used for readability.
- Use a pipe symbol to separate each column of row data.
- There can be multiple rows of pipe symbols on row start and end are optional.
- table’s data like header and row can contain simple text or markdown content
Include content format styles
table cell data can include all other markdown content styles like links, bold if cell content wants to include pipe or backtick symbols, symbols need to be escaped.
table data can include
|Header1 |Header2 | Header3|
|--- | --- | ---|
|**bold style**| `code block`|data3|
|\|escape pipe|\`backtick|data13|
Output is
Header1 | Header2 | Header3 |
---|---|---|
bold style | code block | italic |
|escape pipe | `backtick | data13 |
Align cell data using the colon symbol
header and cell data align to the left or right of a column in a table. The below example explains alignment.
- Content to align left by prefix colon
:
before dashes -:---
- Right align by suffix colon
:
after dashes ----:
- Centre align by prefix and suffix colon
:
for dashes -:---:
|Header1 |Header2 | Header3|
|:--- | ---: | :---:|
|Aligh left| Alighn right|center text|
|cell data1|cell data2|cell data3|
Example for aligning table data
Header1 | Header2 | Header3 |
---|---|---|
Aligh left | Alighn right | center text |
cell data1 | cell data2 | cell data3 |