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

10
LINES

< > BotCompany Repo | #1026599 // htmlForJLabel_chatConvo_table

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

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

1  
// pairs: (HTML text, false=left/true=right)
2  
sS htmlForJLabel_chatConvo_table(LPair<S, Bool> dialog, int width) {
3  
  ret tag table(lines(mapPairsToList(dialog, (contents, right) -> {
4  
    S color = right ? "#9999FF" : "#99FF99";
5  
    int fontSize = right ? 13 : 15;
6  
    
7  
    ret tr(td(tag table(tr(td(contents, style := "font-size: \*fontSize*/px; background: \*color*/; padding: 5px"))),
8  
      align := right ? "right" : null, style := "margin-" + (right ? "left" : "right") + ": 20px"));
9  
  })), +width);
10  
}

Author comment

Began life as a copy of #1026592

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026599
Snippet name: htmlForJLabel_chatConvo_table
Eternal ID of this version: #1026599/4
Text MD5: 731b688a889171b627ebcae4823d3144
Transpilation MD5: 3061271220fbd1c4e66ac577307c1b58
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-15 15:01:32
Source code size: 513 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 156 / 232
Version history: 3 change(s)
Referenced in: [show references]