Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1022704 // asciiTable (with header)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2703L/17K).

sS asciiTable(LS headers, LL<S> data) {
  new L<LS> buffers;
  for i over headers:
    addAll(listGetOrCreate_List(buffers, i), headers.get(i), " ");

  for unnull (LS line : data)
    for i over line:
      listGetOrCreate_List(buffers, i).add(line.get(i));
      
  LS lines = lines(asciiSideBySideWithBarsAllAround(map lines(buffers)));
  if (l(lines) > 2)
    lines.set(2, lines.get(2).replace(" ", "-"));
  ret lines(lines);
}

Author comment

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: 329 / 407
Version history: 4 change(s)
Referenced in: [show references]