Libraryless. Click here for Pure Java version (2703L/17K).
1 | sS asciiTable(LS headers, LL<S> data) {
|
2 | new L<LS> buffers; |
3 | for i over headers: |
4 | addAll(listGetOrCreate_List(buffers, i), headers.get(i), " "); |
5 | |
6 | for unnull (LS line : data) |
7 | for i over line: |
8 | listGetOrCreate_List(buffers, i).add(line.get(i)); |
9 | |
10 | LS lines = lines(asciiSideBySideWithBarsAllAround(map lines(buffers))); |
11 | if (l(lines) > 2) |
12 | lines.set(2, lines.get(2).replace(" ", "-"));
|
13 | ret lines(lines); |
14 | } |
Began life as a copy of #1014820
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1022704 |
| Snippet name: | asciiTable (with header) |
| Eternal ID of this version: | #1022704/5 |
| Text MD5: | c8110bf917d6e7f4a52c0bddf846f7cd |
| Transpilation MD5: | 058c1aa2428305e208a70600c1474407 |
| Author: | stefan |
| Category: | javax / ascii |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-03-31 21:52:53 |
| Source code size: | 444 bytes / 14 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 567 / 699 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |