Is there an option or method for Framed analogous to Frame in Graphics to control display of individual edges, eg bottom, left, top, right?

Framed is useful for visualizing nested structures, but often 4 sides are redundant, eg in this healthcare related prototype would like to display only the left edges:

If not an option, is there a workaround that does not explicitly involve Graphics?

enter image description here

  • 2
    $\begingroup$ In version 8, it used to be possible to do something like this, see this question and answer. Unfortunately, it no longer works in version 10. $\endgroup$
    – Jens
    Commented Jun 23, 2016 at 4:50
  • $\begingroup$ Related: (21082) $\endgroup$
    – Mr.Wizard
    Commented Jul 19, 2016 at 18:49

2 Answers 2


Would a CellFrame around a TextCell work?

 x -> TextCell[
   Column[{"Depression", "PTSD", "Diabetes Type II", "Smoker"}], 
   CellFrame -> {{True, False}, {False, False}}]]

Mathematica graphics

  • $\begingroup$ Great, is it possible to control line width? $\endgroup$ Commented Jun 29, 2016 at 21:12
  • $\begingroup$ @alancalvitti Harder than I thought, given that CellFrameStyle shows up in the option inspector: System`CellFrameStyle -> {{AbsoluteThickness[12], None}, {None, None}} yields this. Note that (on V10.4.1) CellFrameStyle is not already in the System` context and Global`CellFrameStyle won't work. -- Just checked and "CellFrameStyle" -> {{AbsoluteThickness[12], None}, {None, None}} also works. $\endgroup$
    – Michael E2
    Commented Jun 29, 2016 at 21:22

An alternative way of getting a similar display would be to define a new function leftFramed that only puts a vertical extensible line to the left of the content:

leftFrame /: MakeBoxes[leftFrame[obj_], _] := 
 RowBox[{"\[LeftBracketingBar]", ToBoxes[obj]}]

Framed[x -> 
   Column[{"Depression", "PTSD", "Diabetes Type II", "Smoker"}]]]


You can see that this vertical line is in fact an extensible character, not a graphical line.

In the same vein, you could also use other extensible symbols to decorate the left side:

leftBrace /: MakeBoxes[leftBrace[obj_], _] := 
 StyleBox[RowBox[{"{", ToBoxes[obj]}], SpanMaxSize -> Infinity]

Framed[x -> 
   Column[{"Depression", "PTSD", "Diabetes Type II", "Smoker"}]]]


  • $\begingroup$ Jens, yours is a nice approach too, I will likely use it as well, but accepted Michael E2 because TextCell seems easier more user friendly. $\endgroup$ Commented Jul 13, 2016 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.