Comments (4)
Correct me if I'm wrong, but isn't it the option markdown-table-formatter.defaultTableJustification
, as it says in the config "Defines the default justification for tables that have only a "-" on the formatting line"
You could set it to Right
(e.g) and type like below
| Header 1 | Header 2 |
|-|-|
| Line 1 - Col 1 | Line 1 - Col 2 |
| Line 2 - Col 1 | Line 2 - Col 2 |
To have it output like this
Header 1 | Header 2 |
---|---|
Line 1 - Col 1 | Line 1 - Col 2 |
Line 2 - Col 1 | Line 2 - Col 2 |
But the following
| Header 1 | Header 2 |
|||
| Line 1 - Col 1 | Line 1 - Col 2 |
| Line 2 - Col 1 | Line 2 - Col 2 |
and this other one
| Header 1 | Header 2 |
| Line 1 - Col 1 | Line 1 - Col 2 |
| Line 2 - Col 1 | Line 2 - Col 2 |
are not valid extended markdown syntax as noted on MultiMarkdown Table Rules.
The “separator” line uses ---- or ==== to indicate the line between a header and cell. The length of the line doesn’t matter, but must have at least one character per cell.
[emphasis added]
I understand that having to type one less character "-" per column could be useful in some situations. Bu I need to see if it will have any side effects on the rest of the code.
I will keep this issue open while I study this case.
from vscode-markdown-table-formatter.
thanks for responding.
Please note the following from http://fletcher.github.io/MultiMarkdown-5/tables.html#tablerules
...If no colon is present, the default alignment of your system is selected (left in most cases).
I have always formatted md tables in this manner:
| Header 1 | Header 2 |
| -------- | -------- |
| Line 1 - Col 1 | Line 1 - Col 2 |
| Line 2 - Col 1 | Line 2 - Col 2 |
resulting in
Header 1 | Header 2 |
---|---|
Line 1 - Col 1 | Line 1 - Col 2 |
Line 2 - Col 1 | Line 2 - Col 2 |
I think this is a cleaner look in md. The following is also valid:
| Header 1 | Header 2 |
|----------|----------|
| Line 1 - Col 1 | Line 1 - Col 2 |
| Line 2 - Col 1 | Line 2 - Col 2 |
resulting in
Header 1 | Header 2 |
---|---|
Line 1 - Col 1 | Line 1 - Col 2 |
Line 2 - Col 1 | Line 2 - Col 2 |
from vscode-markdown-table-formatter.
Oh, thank you, some how I missed that... I will take a look on how to include this!
from vscode-markdown-table-formatter.
Included in v1.4.0. I added a flag to it called removeColonsIfSameAsDefault
which is defaulted to false. If you have any other bug fix or feature requests please page me.
Thank you for using my extension and helping improve it.
from vscode-markdown-table-formatter.
Related Issues (20)
- Installation Problem HOT 4
- unable to format single column tables
- Formatting removes indentation of tables HOT 1
- Add an option to choose table separators spacing HOT 3
- Extension causes high cpu load HOT 10
- Numeric sort in tables HOT 4
- Unable to format with extension HOT 8
- First and last pipe are not kept when sorting HOT 1
- Open VSX HOT 2
- Backtick ` causes skipped cell HOT 1
- Mis-detecting code block as table HOT 1
- Feature Request: Add CodeLens to format table
- Doesn't work HOT 2
- Support heading separator with Spaces/Tabs HOT 6
- Feature request: Limit Last Column Width tied to header, not wordWrapColumn HOT 2
- Sort - Ignore Case HOT 2
- Add "sort" in actions - available via command palette HOT 1
- Wrong whitespace padding when formatting content with emojis
- apply on other plain-text tables too? HOT 1
- Feature request: jump to next column and format the table on [Tab] pressed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-markdown-table-formatter.