General XMetaL Discussion

  • scotth

    Centering Thead Text

    Participants 2
    Replies 3
    Last Activity 9 years, 2 months ago

    Can I center align text within a thead entry element when no value is provided for align? I'm using xmetal 6 and tried to achieve this via CSS. Unfortunately, the text always seems to left align unless i specifically set the align attribute for the entry to center. I wasn't sure if I just wasn't getting the CSS right or if this is just a part of the way that XMetaL handles cals tables.

    Reply

    Derek Read

    Reply to: Centering Thead Text

    I'm pretty sure* this means you have a more specific CSS setting in your customization, or one that is as specific but defined later in your CSS.

    *I'd be 100% but there's always a chance you've uncovered some limitation.

    Reply

    scotth

    Reply to: Centering Thead Text

    Based on your comment, I went back and did further testing. It is worth mentioning that the schema that I'm working with for this project allows text directly inside an entry element, which was not true of previous schemas that I worked with. It appears that I can get text contained within a child element to center, but not text that is entered directly into the entry element.

    I ended up commenting out all alignment styles from my customization and then added the following style. It successfully centered child elements of the entry, but not the text contained directly within the entry. The other styles were applied correctly to the text.

    thead>row>entry, thead>row>entry *
    {
            text-align: center;
    font-weight: bold;
    padding: 4px;
    background-color: Yellow;
    }

    Reply

    Derek Read

    Reply to: Centering Thead Text

    Looks like you are correct. I've now tested your scenario with the DocBook 5 sample that we include (it allows a similar model for CALS tables). It looks like you really can't override the alignment for a CALS entry element using CSS, though you can set alignment for any children using CSS. Basically the same results you are seeing. The attribute value takes precedence, with it defaulting to left aligned even when the align attribute is not set. That left alignment isn't really overriding any CSS text-align you have set, the CSS just doesn't come into play.

    We have a fairly long history of clients requesting conflicting features when it comes to CALS vs CSS and so for the most part we have allowed the CALS spec to win and to not support most kinds of CSS styling for CALS tables. Unfortunately, a lot of what is defined in CALS (and HTML in fact) is presentational, which goes against what most of us think XML to be all about. In order to support both camps I think we might need to eventually put in some other setting to allow customizers to define their preference for one over the other.

    Reply

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

Lost Your Password?

Products
Downloads
Support