vkocubinsky / SublimeTableEditor

This package is no more supported. I moved to vim.
Other
494 stars 67 forks source link

Add support for MultiMarkdown table syntax #10

Closed xldenis closed 11 years ago

xldenis commented 12 years ago

It would be great if this plugin could support the features of MultiMarkdown tables. Most notable being able to combine multiple columns to create ultra wide rows.

vkocubinsky commented 12 years ago

Thanks for feedback.

I quick analysed MultiMarkdown tables.

There are list of differnces from "Table Editor" tables:

This is example from https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide:

    |             |          Grouping           ||
    First Header  | Second Header | Third Header |
     ------------ | :-----------: | -----------: |
    Content       |          *Long Cell*        ||
    Content       |   **Cell**    |         Cell |
    New section   |     More      |         Data |
    And more      |            And more          |

Let's for "Table Editor" user should type the table as this:

    |               |          Grouping           ||
    | First Header  | Second Header | Third Header |
    |---------------|:-------------:|-------------:|
    | Content       |          *Long Cell*        ||
    | Content       |   **Cell**    |         Cell |
    | New section   |     More      |         Data |
    | And more      |            And more         ||

There are difference between these 2 tables:

Could you say:

Thanks!

xldenis commented 12 years ago

The second table is valid. However, when using table edit if you hit tab it reformats to get rid of any || sections. It would also be nice to be able to specify alignment in the table like MultiMarkdown does with the :-------- and ------: syntax.

vkocubinsky commented 12 years ago

I have added MultiMakrdown column alignment in 1.1.0. You can use :--- , ---:, --- when you edit MultiMarkdow files. For other file types you can set support multimarkdown with settings

"table_editor_syntax": "MultiMarkdown"

You can also temporary turn on multimarkdown syntax for any type files with launch command palette and select "Table Editor: Set table syntax 'MultiMarkdown' for current view"

For now colspan feature is not supported.

xldenis commented 11 years ago

Sorry for not replying earlier, but thanks for the alignment, I know this will be useful for me.

2called-chaos commented 11 years ago

Is it intended that the header alignment changes as soon as I use this?

|      foo       |
|----------------|
| somelongstring |
| shorter        |

changes to

| foo            |
| -------------: |
| somelongstring |
|        shorter |

fixable with the following but this isn't parseable by markdown anymore.

| :------------: |
|      foo       |
| -------------: |
| somelongstring |
|        shorter |
xldenis commented 11 years ago

I am a bit confused by your problem, what isn't working? Your first two examples render to

foo
somelongstring
shorter

and

foo
somelongstring
shorter

However, the third example doesn't render, is that the problem? I believe the third example simply isn't valid markdown as there are multiple separator lines. I can't seem to find any examples in the syntax definition that would show otherwise and my attempts at rendering it all fail as soon as a second line of dashes is introduced.

vkocubinsky commented 11 years ago

Thanks for feedback. I see what is the problem. The problem is that "foo" is header and you expected that "foo" will align to center in any case and other values in column will align to right, because you specify column alignment. But actual result is "foo" alignments to left. This is a bug in Table Editor.

vkocubinsky commented 11 years ago

Fixed header alignment in 1.2.0

vkocubinsky commented 11 years ago

Version 1.5.0 supports multi markdown colspan feature(alpha status). You can try to use this.