Open-source implementation of Markdown for C# and Javascript
This fork of original [topsoftware/markdowndeep] project implements some new Table feature:
- multiple header rows: any row before separator-row will be added in
thead
tag of table. - colspan: you can define how many columns will be occuped by cell.
- Header style: if content starts with # the tagname of cell will be
th
instead oftd
. - cell alignment: you can customize alignment cell by cell.
This fork solves some minor issue in table:
- cell count wrong in tables with bad formatting
Any row inserted before the "separator row" will be added in thead
tag of table.
| Your name | Your name | Home | Home | Office | Office | Office |
| First name | Last name | address | city | address | city | Email |
|:-----------|:----------|:--------|:-----:|:--------|:------:|:------------|
| Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
| James | White | ss... | NY | ss.. | CA | bb@acme.com |
| ... | ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... | ... |
Your name | Your name | Home | Home | Office | Office | Office |
---|---|---|---|---|---|---|
First name | Last name | address | city | address | city | |
Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
James | White | ss... | NY | ss.. | CA | bb@acme.com |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
Like MultiMarkdown, fspezi/markdowndeep implements table colspan:
| Your name || Home || Office |||
| First name | Last name | address | city | address | city | Email |
|:-----------|:----------|:--------|:-----:|:--------|:-----:|:------------|
| Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
| James | White | ss... | NY | ss.. | CA | bb@acme.com |
| ... | ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... | ... |
Your name | Home | Office | ||||
---|---|---|---|---|---|---|
First name | Last name | address | city | address | city | |
Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
James | White | ss... | NY | ss.. | CA | bb@acme.com |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
Any |
added to the end of cell will be counted to determine the colspan value.
You can mark any cell to declare it as Header cell.
| Your name || Home || Office |||
| First name | Last name | address | city | address | city | Email |
|:-----------|:----------|:--------|:-----:|:--------|:-----:|:------------|
|# Mark |# Deep | ss... | NY | ss.... | WH | aa@acme.com |
|# James |# White | ss... | NY | ss.. | CA | bb@acme.com |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
Your name | Home | Office | ||||
---|---|---|---|---|---|---|
First name | Last name | address | city | address | city | |
Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
James | White | ss... | NY | ss.. | CA | bb@acme.com |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
Start the cell with #
string: Markdown will be render that cell with th
tag instead of td
.
Note: this feature don't works with header cells.
You can customize horizontal alignment of any cell.
|: Your name :||: Home :||: Office :|||
| First name | Last name | address | city | address | city | Email |
|:-----------|:----------|:--------|:-----:|:--------|:-----:|:------------|
|# Mark |# Deep | ss... | NY | ss.... | WH | aa@acme.com |
|# James |# White | ss... | NY | ss.. | CA | bb@acme.com |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
Your name | Home | Office | ||||
---|---|---|---|---|---|---|
First name | Last name | address | city | address | city | |
Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
James | White | ss... | NY | ss.. | CA | bb@acme.com |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
Use the same syntax of alignment when you define it in separator-row.
Note: if you want define "left or center alignment" and "header style" together, type :
before #
.
|: Your name :||: Home :||: Office :|||
| First name | Last name | address | city | address | city | Email |
|:-----------|:----------|:--------|:-----:|:--------|:-----:|:---------------|
|# Mark |# Deep | ss... | NY | ss.... | WH | aa@acme.com |
|# James |# White | ss... | NY | ss.. | CA | bb@acme.com |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
|# ... |# ... | ... | ... | ... | ... | ... |
| ||||||:# 6 employees :|
Your name | Home | Office | ||||
---|---|---|---|---|---|---|
First name | Last name | address | city | address | city | |
Mark | Deep | ss... | NY | ss.... | WH | aa@acme.com |
James | White | ss... | NY | ss.. | CA | bb@acme.com |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
... | ... | ... | ... | ... | ... | ... |
6 employees |
Copyright (c) 2013 Xilium di Flavio Spezi - Italy
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.