Home Forums General XMetaL Discussion Horizontal Alignment in tables (XMAX/XMetaL v6.5) Reply To: Horizontal Alignment in tables (XMAX/XMetaL v6.5)

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”] * {
 text-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).

Reply

Products
Downloads
Support