Giter Site home page Giter Site logo

Comments (4)

fcrespo82 avatar fcrespo82 commented on June 25, 2024

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.

bcullman avatar bcullman commented on June 25, 2024

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.

fcrespo82 avatar fcrespo82 commented on June 25, 2024

Oh, thank you, some how I missed that... I will take a look on how to include this!

from vscode-markdown-table-formatter.

fcrespo82 avatar fcrespo82 commented on June 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.