|
16 | 16 | * [Column Width](#table-usage-column-width) |
17 | 17 | * [Custom Border](#table-usage-custom-border) |
18 | 18 | * [Draw Horizontal Line](#table-usage-draw-horizontal-line) |
| 19 | + * [Single Line Mode](#table-usage-single-line-mode) |
19 | 20 | * [Padding Cell Content](#table-usage-padding-cell-content) |
20 | 21 | * [Predefined Border Templates](#table-usage-predefined-border-templates) |
21 | 22 | * [Streaming](#table-usage-streaming) |
@@ -341,6 +342,49 @@ console.log(output); |
341 | 342 |
|
342 | 343 | ``` |
343 | 344 |
|
| 345 | +<a name="table-usage-single-line-mode"></a> |
| 346 | +### Single Line Mode |
| 347 | + |
| 348 | +Horizontal lines inside the table are not drawn. |
| 349 | + |
| 350 | +```js |
| 351 | +import { |
| 352 | + table, |
| 353 | + getBorderCharacters |
| 354 | +} from 'table'; |
| 355 | + |
| 356 | +const data = [ |
| 357 | + ['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'], |
| 358 | + ['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'], |
| 359 | + ['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'], |
| 360 | + ['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'], |
| 361 | + ['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'], |
| 362 | + ['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'], |
| 363 | + ['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'], |
| 364 | + ['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'], |
| 365 | +]; |
| 366 | + |
| 367 | +const config = { |
| 368 | + singleLine: true |
| 369 | +}; |
| 370 | + |
| 371 | +const output = table(data, config); |
| 372 | +console.log(output); |
| 373 | +``` |
| 374 | + |
| 375 | +``` |
| 376 | +╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ |
| 377 | +║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║ |
| 378 | +║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║ |
| 379 | +║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║ |
| 380 | +║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║ |
| 381 | +║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║ |
| 382 | +║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║ |
| 383 | +║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║ |
| 384 | +║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║ |
| 385 | +╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ |
| 386 | +``` |
| 387 | + |
344 | 388 | <a name="table-usage-padding-cell-content"></a> |
345 | 389 | ### Padding Cell Content |
346 | 390 |
|
|
0 commit comments