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

19
LINES

< > BotCompany Repo | #1030189 // htitledSectionWithDiv - create titled section in HTML (like jSection) [not <section> tag]

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

Libraryless. Click here for Pure Java version (4363L/25K).

// design by Kriti Shankar Senapati
// title is in HTML
sS htitledSectionWithDiv(S title, O contents, O... _) {
  S backgroundColor = "#fff"; // TODO: grab from params
  S labelStyle = "width: auto; float: top; position: relative; top: -.6em; left:15px; background-color: " + backgroundColor;
  
  S innerDivStyle = stringPar innerDivStyle(_);
  S innerDivClass = stringPar innerDivClass(_);
  optPar S innerDivID;
  _ = paramsMinus(_, "innerDivStyle", "innerDivID", "innerDivClass");

  ret div(
      htag label(b("&nbsp;" + title + "&nbsp;"), style := labelStyle)
    + div(contents,
      style := joinNemptiesWithSemicolon(innerDivStyle, "padding-left: 15px"),
        class := joinNemptiesWithSpace("sectionContents", innerDivClass),
        id := innerDivID),
      params_stylePlus("border: 2px solid", _);
}

Author comment

Began life as a copy of #1030187

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030189
Snippet name: htitledSectionWithDiv - create titled section in HTML (like jSection) [not <section> tag]
Eternal ID of this version: #1030189/11
Text MD5: 36c210c4f745b103ab1dd3cc3ad9191e
Transpilation MD5: 23756971ac349da440f4af15e14585cf
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-22 17:43:45
Source code size: 834 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 263 / 380
Version history: 10 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1032577 - HtitledSection - successor of htitledSectionWithDiv. create titled section in HTML (like jSection) [not <section> tag]