Skip to content

HJava/drawTableWithChars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

drawTableWithChars

用纯字符画出表格。Draw tables with chars.

使用 Usage:

@param {Dom} 父级dom节点
@param {Object} 描述表格内容对象

drawTables.init(document.getElementById('ctn'), {
    title: ['name', 'age', 'sex'],
    direction: [0, 'age'],
    data: [
        ['haasdfha', 10, { content: 'heihei', col: 4, row: 3 }],
        ['hehe', 10],
        ['haasdfha', 10, 'male'],
        [
            { content: 'heihei', col: 4, row: 3 },
            { content: 'heihei', col: 4, row: 3 },
        ],
        [
            { content: 'heihei', col: 4, row: 3 },
            {}
        ]
    ]
});

展示 Show:

|-----------------------------------------------------------------------|
|     name | age | sex    |  |        |  |      |  |        |  |  |  |  |
|----------|-----|--------|--|--------|--|------|--|--------|--|--|--|--|
| haasdfha |  10 | heihei                |      |  |        |  |  |  |  |
|----------|-----|                       |------|--|--------|--|--|--|--|
|     hehe |  10 |                       |      |  |        |  |  |  |  |
|----------|-----|                       |------|--|--------|--|--|--|--|
| haasdfha |  10 |                       | male |  |        |  |  |  |  |
|----------|-----|--------|--|--------|--|------|--|--------|--|--|--|--|
|   heihei                   | heihei              |        |  |  |  |  |
|                            |                     |--------|--|--|--|--|
|                            |                     | heihei          |  |
|                            |                     |                 |--|
|                            |                     |                 |  |
|----------|-----|--------|--|--------|--|------|--|                 |--|
|          |     |        |  |        |  |      |  |                 |  |
|-----------------------------------------------------------------------|

About

用纯字符画出表格。Draw tables with chars.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published