I am trying to create a framed cell around cells that collapse and expand. Mr. Wizard's answer below almost does it, however, when the cells are collapsed I lose the lower frame border. I'd like to keep it. Here is his code. I'm having trouble fixing this. Can someone help?
Button["Frame Multiple Cells",
With[{cells = Cells[NotebookSelection[InputNotebook[]]]},
MapThread[
Function[{frame, pos},
MapAt[
SetOptions[#,
CellMargins -> {{66, 10}, {0, 0}},
CellFrame -> {{2, 2}, frame},
Background -> LightBlue] &,
cells,
pos
]
],
{{{0, 2}, {0, 0}, {2, 0}}, {1, 2 ;; -2, -1}}
]
]
] // CreatePalette
