Home › Forums › General XMetaL Discussion › Display Element As Table Without Border › Reply To: Display Element As Table Without Border
Reply to: Display Element As Table Without Border
September 14, 2011 at 9:13 pmYou can get pretty close to what they have there I think. Because there is no element surrounding each pair of
/* Note: when display is not defined the default is display:inline */
dl {
display: block;
border: 3px solid #ccc;
}
dt {
font-weight: bold;
color: green;
}
dt:before {
/*000d = carriage return*/
content: " 00d";
}
dt:after {
/*00a0 = non-breaking space*/
content: ": 0a0";
}
I use the non-breaking space in dt:after because it needs to use display:inline to keep it on the same line and XMetaL doesn't render padding or margin for inline elements.
If the model was like this (another element wrapping each pair) then the CSS would be simpler:
In that case you could use the standard normal methods for styling lists (ELEM would just use display:list-item in that case with list-style set to whatever you want including nothing), or set dl and ELEM to both use display:block with some indenting if you like.
If the client does not care that the elements appear on the same line then you could do the following instead. This might be more acceptable to authors, particularly in Tags On view where the first method might prove confusing due to the way opening tags are handled.
dl {
display: block;
border: 3px solid #ccc;
}
dt {
display: block;
font-weight: bold;
color: green;
}
dt:after {
content: ":";
}
dd {
display: block;
padding-left: 2em;
}