Fun example:
Here's both a header and a footer using Mathematica's built in nine-patch images:
CellPrint[
Cell[ExampleData[{"Text", "LoremIpsum"}]~Snippet~5, "Text",
CellFrame -> {{1, 1}, {1, 1}},
FrontEnd`CellFrameStyle -> GrayLevel[.8],
CellFrameLabelMargins -> {{0, 0}, {-1, -1}},
CellFrameLabels -> {
{None, None},
{
ToBoxes@
Panel["Cell footer",
BaseStyle -> {
(*turn this into an actual stylesheet style for better \
customizability/inheritance*)
"Text",
FontColor -> Hue[0, .5, .5],
ShowStringCharacters -> False,
PanelBoxOptions -> {
FrameStyle -> Black,
ImageSize -> {
FEPrivate`Switch[
FEPrivate`$OperatingSystem,
"MacOSX", 18,
"Window", 0,
"Linux", 0,
_, 0] + Scaled[1],
Automatic
},
FrameMargins -> {{10, 10}, {5, 5}},
Appearance -> {
"Default" ->
FrontEnd`FileName[{"Ribbons", "Common"},
"ContentAreaGradient.9.png"]
}
}
}
],
ToBoxes@
Panel["Cell header",
BaseStyle -> {
(*turn this into an actual stylesheet style for better \
customizability/inheritance*)
"Text",
FontColor -> Hue[0, .5, .5],
ShowStringCharacters -> False,
PanelBoxOptions -> {
Appearance -> {
"Default" ->
FrontEnd`FileName[{"Dialogs", "CloudDialogs"},
"AttachedCell.9.png"]
},
ImageSize -> {
FEPrivate`Switch[
FEPrivate`$OperatingSystem,
"MacOSX", 18,
"Window", 0,
"Linux", 0,
_, 0] + Scaled[1],
Automatic
},
FrameMargins -> {{10, 10}, {5, 5}}
}
}
]
}
}
]
]

Original
Here are two options:
Boxes
This one works really simply:
CellPrint[
Cell["Test content",
"Text",
CellFrame -> True,
CellFrameLabelMargins -> {{0, 0}, {0, -2}},
CellSize -> {Automatic, 100},
CellFrameLabels -> {
{None, None},
{None,
ToBoxes@
Framed["asdasd",
BaseStyle -> {
(*
turn this into an actual stylesheet style for better customizability/inheritance *)
"Text",
FontColor -> White,
ShowStringCharacters -> False,
FrameBoxOptions -> {
FrameStyle -> Black,
ImageSize ->
{
FEPrivate`Switch[
FEPrivate`$OperatingSystem,
"MacOSX", 18,
"Window", 0(* Windows fudge factor *),
"Linux", 0(* Linux fudge factor *),
_, 0
] + Scaled[1],
Automatic
},
FrameMargins -> {{10, 10}, {5, 5}},
Background -> Blue
}
}
]
}
}
]
]

Outside of the weird 18 pixel fudge factor which it turns out has nothing to do with the CellMargins
, "VerticalScrollBar"
, CellBracketOptions
, ShowCellBracket
or any of the other things I tested this one takes the cake for convenience.
If you substitute in PanelBox
you can leverage the paneled appearance really nicely. Here's what Panel
looks like with FrameBoxOptions
changed to PanelBoxOptions
and the addition of
Appearance -> {
"Default" ->
FrontEnd`FileName[{"Ribbons", "Common"},
"ContentAreaGradient.9.png"]
}

Cells
This is much trickier but here's what I got:
CellPrint[
Cell["Test content", "Text",
CellFrame -> True,
CellFrameLabelMargins -> {{0, 0}, {0, 0}},
CellMargins -> {{25, 55}, {5, 5}},
CellBracketOptions -> {
"Widths" -> {0, 15},
"OverlapContent" -> True
},
CellFrameLabels ->
{
{None, None},
{None,
Cell["Test label", "Text",
Background -> Blue,
FontColor -> White,
CellFrame -> {{1, 1}, {0, 1}},
CellMargins -> 0,
CellFrameMargins -> {{50, 50}, {5, 5}},
CellSize -> {
FEPrivate`Part[
FrontEnd`AbsoluteCurrentValue[
FrontEnd`EvaluationNotebook[], WindowSize],
1
]/
FrontEnd`AbsoluteCurrentValue[
FrontEnd`EvaluationNotebook[], Magnification] - (
FEPrivate`Part[
FrontEnd`AbsoluteCurrentValue[
FrontEnd`ParentCell@FrontEnd`EvaluationCell[],
CellMargins
],
1, 1
] +
FEPrivate`Part[
FrontEnd`AbsoluteCurrentValue[
FrontEnd`ParentCell@FrontEnd`EvaluationCell[],
CellMargins
],
1, 2
] +
(* dunno where the fudge factors here are coming from...*)
FEPrivate`If[
FEPrivate`SameQ[
FrontEnd`AbsoluteCurrentValue[
FrontEnd`ParentCell@FrontEnd`EvaluationCell[],
{CellBracketOptions, "OverlapContent"}
],
True
],
0,
FEPrivate`Part[
FrontEnd`AbsoluteCurrentValue[
FrontEnd`ParentCell@FrontEnd`EvaluationCell[],
{CellBracketOptions, "Widths"}
],
2
] +
3/FrontEnd`AbsoluteCurrentValue[
FrontEnd`EvaluationNotebook[], Magnification]
] +
FEPrivate`If[
FEPrivate`MemberQ[
FrontEnd`AbsoluteCurrentValue[
FrontEnd`EvaluationNotebook[],
WindowElements
],
"VerticalScrollBar"
],
15/FrontEnd`AbsoluteCurrentValue[
FrontEnd`EvaluationNotebook[], Magnification],
0
]
),
Automatic
}
]
}
}
]
]
You'll notice there are many more fudge factor here to tweak, but it seems to again handle the many settings I've tried and it looks like:

CellFrameLabelAlignment
option $\endgroup$CellDisplayFunction
or something similar. $\endgroup$