|
| 1 | +#drawTableWithChars |
| 2 | + |
| 3 | +用纯字符画出表格。Draw tables with chars. |
| 4 | + |
| 5 | +###使用 Usage: |
| 6 | +@param {Dom} 父级dom节点 |
| 7 | +@param {Object} 描述表格内容对象 |
| 8 | + |
| 9 | +```js |
| 10 | +drawTables.init(document.getElementById('ctn'), { |
| 11 | + title: ['name', 'age', 'sex'], |
| 12 | + direction: [0, 'age'], |
| 13 | + data: [ |
| 14 | + ['haasdfha', 10, {content: 'heihei', col: 4, row: 3}], |
| 15 | + ['hehe', 10], |
| 16 | + ['haasdfha', 10, 'male'], |
| 17 | + [ |
| 18 | + {content: 'heihei', col: 4, row: 3}, |
| 19 | + {content: 'heihei', col: 4, row: 3}, |
| 20 | + ], |
| 21 | + [ |
| 22 | + {content: 'heihei', col: 4, row: 3}, |
| 23 | + {} |
| 24 | + ] |
| 25 | + ] |
| 26 | + }); |
| 27 | +``` |
| 28 | + |
| 29 | +### 展示 Show: |
| 30 | +``` |
| 31 | +|-----------------------------------------------------------------------| |
| 32 | +| name | age | sex | | | | | | | | | | | |
| 33 | +|----------|-----|--------|--|--------|--|------|--|--------|--|--|--|--| |
| 34 | +| haasdfha | 10 | heihei | | | | | | | | |
| 35 | +|----------|-----| |------|--|--------|--|--|--|--| |
| 36 | +| hehe | 10 | | | | | | | | | |
| 37 | +|----------|-----| |------|--|--------|--|--|--|--| |
| 38 | +| haasdfha | 10 | | male | | | | | | | |
| 39 | +|----------|-----|--------|--|--------|--|------|--|--------|--|--|--|--| |
| 40 | +| heihei | heihei | | | | | | |
| 41 | +| | |--------|--|--|--|--| |
| 42 | +| | | heihei | | |
| 43 | +| | | |--| |
| 44 | +| | | | | |
| 45 | +|----------|-----|--------|--|--------|--|------|--| |--| |
| 46 | +| | | | | | | | | | | |
| 47 | +|-----------------------------------------------------------------------| |
| 48 | +``` |
0 commit comments