ArchCST
ArchCST

Reputation: 135

How to insert a markdown table in IntelliJ IDEA?

I'm using IDEA 2019.3 Ultimate edition which ships with markdown support. I'm trying to insert a table like this:

| Key   | Func   |
|-------|--------|
| cmd+n | search |

but I found tab not working and IDEA doesn't help to indent the table so I have to manually add lots of -. Is there an efficient way to insert a table in IDEA?

Upvotes: 12

Views: 8679

Answers (6)

Ivan Posti
Ivan Posti

Reputation: 86

Since 2022.1 you can use Code > Generate... > Table or Insert... > Table (cmd-N) to insert tables.

You can checkout official IDEA documentation for table support in Markdown plugin.

Upvotes: 7

HudsonGraeme
HudsonGraeme

Reputation: 505

This does not address the OP's original problem, but hopefully it can help others that arrive here as a result of IDEA not rendering their markdown tables.

In my case I needed to add more - characters on the second line. IDEA seems to require a minimum of 3 dashes in order to display the markdown table.

Incorrect

Input

| Some | Table | Header | Values | 
| :-: | :-: | :-- | --: |
| Centre | Centre | Left | Right |

Output

| Some | Table | Header | Values | 
| :-: | :-: | :-- | --: |
| Centre | Centre | Left | Right |

Correct

Input

| Some | Table | Header | Values | 
| :---: | :---: | :--- | ---: | 
| Centre | Centre | Left | Right |

Output

 -----------------------------------
|  Some  |  Table | Header | Values |
| Centre | Centre | Left   |  Right |
 -----------------------------------

Upvotes: 2

valeesi
valeesi

Reputation: 195

Make sure there is an empty line above the table for it to be rendered:

Some texts:

| Tables   |      Are      |  Cool |
|----------|:-------------:|------:|
| col 1 is |  left-aligned | $1600 |
| col 2 is |    centered   |   $12 |
| col 3 is | right-aligned |    $1 |

(using activedecay's text example)

Upvotes: 7

Vinicius Escame
Vinicius Escame

Reputation: 81

Intellij community edition 2020.3.3

|header 1|header 2|
---|---
|xyz|x|
|xyz|y|

Upvotes: 8

activedecay
activedecay

Reputation: 10867

Works for me in IntelliJ IDEA version 2020.2.3

| Tables   |      Are      |  Cool |
|----------|:-------------:|------:|
| col 1 is |  left-aligned | $1600 |
| col 2 is |    centered   |   $12 |
| col 3 is | right-aligned |    $1 |

Upvotes: 2

Nexonus
Nexonus

Reputation: 814

I don't think this is possible at the moment.

As a workaround you can use the Markdown Table Generator which lets you generate the markdown code while being able to input data in a normal table.

Upvotes: 1

Related Questions