General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Horizontal Alignment in tables (XMAX/XMetaL v6.5)

  • rewers08

    Horizontal Alignment in tables (XMAX/XMetaL v6.5)

    Participants 1
    Replies 2
    Last Activity 12 years, 2 months ago


    for our XMAX implementation we've adopted the HTML table structure in our XML Schema. Most of the things we need work fine. But now we are facing a problem with the horizontal alignment of table cells. As long as a table cell contains only text everything works and the text can be aligned left, center and right. But as soon as a table cell's first child is another XML element (and not plain text) we are having the problem that the element and all it's content is always aligned to the left. The attribute for the alignment is set properly. But the position is always left (tested in XMAX and XMetaL).

    With the vertical alignment we are having NO problems. It's always shown the way it is set in the properties (tested in XMAX and XMetaL).

    Any hints?



    Derek Read

    Reply to: Horizontal Alignment in tables (XMAX/XMetaL v6.5)

    I suspect you have inserted an element that is using CSS display:block inside the table cell. Elements with display:block set on them fill the available width of their container (ie: width – padding). Try inserting an element that does not have display:block set, or that specifically has display:inline (the default) set.

    The align attribute in an HTML table cell is a hard coded behavior for rendering tables that is not connected directly to the CSS rendering engine, so the alignment behavior does not cascade down inside the content of child elements inside table cells. Perhaps that is what you are assuming the behavior will be.

    In order to see the behavior that I assume you want you would need to add CSS similar to the following:

    td[align=”right”] * {

    This is not necessary for inline elements because the entire element can be aligned to the right (which is what happens), since it does not always take up 100% of the width, so in that way it happens to act just like regular text, or an image, when inside a table cell. When you set the CSS above, the content of block elements is aligned to the right. This might not be really obvious, which is why I have created a third screen capture that includes a border around elements, which are styled block so you can see the element's boundary, and the content (the tags and the text).


    Derek Read

    Reply to: Horizontal Alignment in tables (XMAX/XMetaL v6.5)

    I just noticed that the version quoted is 6.5. There is no such version to date, so I assume you are either running 6.0 or 6.1.
    Just wanted to add this for clarity in case someone else gets confused by that.


  • You must be logged in to reply to this topic.

Lost Your Password?