General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Display Element As Table Without Border
-
scotth September 14, 2011 at 5:11 pm
Display Element As Table Without Border
September 14, 2011 at 5:11 pmParticipants 2Replies 3Last Activity 11 years, 4 months agoSomeone pointed me to the following URL for details about how to format non-table elements to appear in a tabular display within XMetaL:
However, the appearance of using display:table seems to be a bit different than it would be using HTML an CSS in a web browser. Is there any way to hide the border when doing a display as table?
Derek Read September 14, 2011 at 5:53 pm
Reply to: Display Element As Table Without Border
September 14, 2011 at 5:53 pmThere is no way to do this for “semantic” tables (anything rendered as a table that is not HTML or CALS).
It is possible to make this work for HTML or CALS tables but the feature is currently entirely within the author's control. If you have an HTML table with @border=”0″ set then the border will be displayed as a dotted line. This gives the author an indication that there really aren't any borders there, but allows them to still navigate the table, which would be very difficult in some cases when the borders are not rendered at all. If there is some content within cells then it may be somewhat easier, but as soon as there is no content it may be impossible to tell what is going on. An additional setting (a user preference) exists on the View menu for those users that really wish to display their HTML or CALS tables with no borders, but this can only be controlled by the user (for previously mentioned reasons). They can toggle the “Show/Hide Table Grid” option on and off.
I think one of two things would need to be changed in the product to support what you want:
1) Implement support for the CSS border property for semantic tables.
2) Implement a way to identify an attribute or other setting that tells XMetaL how thick to draw a border on a particular semantic table (possibly a CTM setting or an API).What is the intention behind what you are doing? I assume it is to more closely match your editing view with your output (that is the usual case and it makes sense in most instances).
I suspect that if you were to test this using the Journalist sample (or DITA authoring functionality if you have XMetaL Author Enterprise) you may find that hiding borders completely might make it difficult to author documents:
1) Create a new Journalist document.
2) Insert a TABLE of any size (columns and rows).
3) On theelement set @border = “0”.
At this point you see dotted lines for table borders.
4) On the View menu select Hide Table Borders.The same can be demoed with DITA:
1) Create a new DITA topic.
2) Insert a table of any size (columns and rows with or without header).
3) On theelement set @frame = “none”.
4) On theelement set @rowsep = 0 and @colsep = 0.
At this point you see dotted lines for table borders.
5) On the View menu select Hide Table Borders.scotth September 14, 2011 at 6:52 pm
Reply to: Display Element As Table Without Border
September 14, 2011 at 6:52 pmIt might be that you know of a completely different way to achieve my end goal within XMetaL. I am hoping to display a definition list in a tabular format without borders. You can find an example at http://www.the-art-of-web.com/css/format-dl/#section_2. Take a look at Example 2 on that page. That is what I have been asked to achieve. I started out by using display: table, but the customer asked me to display a similar layout without borders.
Derek Read September 14, 2011 at 9:13 pm
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
- and
- and you want the pairs to appear on the same line they need to have display:inline set (that's actually the default). At the same time you don't want multiple pairs all on the same line. So we need to introduce a little bit of Unicode character escaping trickery to achieve that. XMetaL does not support “float” because the product really is about authoring content (and we currently feel that letting people place elements arbitrarily inside a document's flow would be disruptive to understanding the relationship between elements). Inserting Unicode characters this way is an unofficial feature and not documented.
/* 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;
} -
AuthorPosts
- You must be logged in to reply to this topic.