valign in CALS tables

Table header in CALS from the customer comes in coded as:

<thead>

     <row>

          <entry colname="column1" .....>Data</entry>

          <entry colname="column2" ....>Data</entry>

          <entry colname="column3" ... valign="top">Data</entry>

          <entry colname="column4"...>Data</entry></row></thead>

In the t5 spec for Header Standard Values, the Vertical style, vstyle is set to center. Therefore, I would assume that Columns 1, 2, and 4 would center vertically and Column 3 would top align; but it doesn't. Instead, Columns 1 and 2 center vertically and columns 3 and 4 both top align (even though only column 3 has the valign="top" attribute/value).  Here's my dilemma:

If I use the <sethrstr;yes> (in the t5 spec as "Restore To Standard Values In Each Header Cell?" yes), then Column 4 will go back to being centered vertically. We have not used this as a standard for tables since it restores values for leading, font family and variant, font height and width and vertical, horizontal and composition style.

If I transform <row> to <row valign="middle">, then Column 4 will go back to being vertically aligned centered with only Column 3 aligning top (without changing the Restore to Standard Values). So I'm thinking I have to go with this choice to make sure the valign only changes for a single cell within an <entry .... valign="top"> without having to use the <sethrstr;yes> in the t5 spec.  So even having the Restore to Standard Value to "no" in the t5 spec, if I have <row valign="middle"> as my element, it does restore the value.  

So what am I missing? 

Thanks and Happy Halloween.

Deb Galligan

  • Deb,

    I'm not entirely sure I understand what you are still missing, but I'll try to guess at it.

    By having <row valign="middle"> you are changing the default valign setting for that particular row to "middle" for all the cells in that row. Then by having <entry ... valign="top"> in that row's cell for Column 3 you are overriding the setting that particular cell's valign to "top".

    Since you have Restore to Standard Value set to "no" in the t5 spec for Header Standard Values, none of the standard value fields in the t5 spec for Header cells will be used at all - these composition values in header cells will just carry from cell to cell, other than being set by CALS attributes or other things you might be doing with markup.

    In this case you are accomplishing the valign setting that you want in each column totally via the CALS attributes.

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • The important thing here is indeed the "restore standard values in each cell" setting.
    Having it set to yes will limit the valign change to the one cell that has the attribute set.
    Having it set to no will not reset that setting at all. (as you have found out).

    I would like to hear from other CALS table users if they to set up the table styles so they restore the standard values or not.
    Anybody?
  • All of ours are set to yes! We also transform all data so that, unless its the default, everything is local at the cell level, so in the example above column 4 would act as the default and the same as columns 1 and 2. The defaults we work with do change on a job by job basis but normally are the columns ranged left and top aligned.
  • If my <row> is set to <row valign="middle"> and I set my third and fourth columns to <entry valign="top">, columns 3 and 4 become top aligned (as expected). Column 5 goes back to middle even with the restore to standard value set to "no". So the "restore to standard value" is not really doing what the manual explains it should do which for "no" is "Does not restore to standard values. Each cell retains the characteristics of the previous cell." For column 5, the previous cell (which is column 4) is "top", but it is restoring column 5 back to "middle". BUT... (of course, there is always a "but"), if I leave <row> as <row> and don't transform it as <row valign="middle">, but keep all the same coding for columns 3, 4, and 5... all three of those columns go "top" (even though column 5 has no valign in it (which means it should restore back to the previous cell).
  • Sorry, Deb, but you are still not understanding everything about how this works.

    You said:

    Column 5 goes back to middle even with the restore to standard value set to "no".  So the "restore to standard value" is not really doing what the manual explains it should do which for "no" is "Does not restore to standard values. Each cell retains the characteristics of the previous cell."

    Yes, the "restore to standard value" is really dong what the manual says it does for "no" - it essentially does nothing.

    If you have "restore to standard value" set to "no" then those standard value fields are not used at all - each cell retains the (standard value) settings of the previous cell - with the understanding that there might be other markup in the table (such as valign="middle" on the <row> tag) or settings in the specs (such as rules at the bottom of the T5 spec setting characteristics for cells) which is effectively setting "default" values for any particular cell.
    As I said the first time, what you seem to be missing is that by using the markup of <row valign="middle"> you are setting a default valign setting of "middle" for that entire row via the CALS attribute on the <row>, not by anything being restored or not in the T5 spec standard values. After the cells with <entry valign="top"> (columns 3 & 4) you have a cell with no valign specified (column 5), so that cell is going to get the valign setting from the value specified in the <row valign="middle"> tag.

    If you do not specify valign="middle" on the <row> tag, then each cell in that row will retain (or inherit) the value of the previous cell, which in some cases is being set to "top" because you are specifying <entry valign="top"> in some cells (columns 3 & 4). Then any cell in the row after that (like column 5) will inherit that setting if that cell does not specify any valign attribute in it's <entry> tag.

    Restore to Standard Values: no
    
    <row valign="middle">
        <entry>middle-aligned via row attribute</entry>
        <entry>middle-aligned via row attribute</entry>
        <entry valign="top">top-aligned via entry attribute</entry>
        <entry valign="top">top-aligned via entry attribute</entry>
        <entry>middle-aligned via row attribute</entry>
    </row>
    
    ...
    
    <row>
        <entry>alignment inherited from previous cell</entry>
        <entry>alignment inherited from previous cell</entry>
        <entry valign="top">top-aligned via entry attribute</entry>
        <entry valign="top">top-aligned via entry attribute</entry>
        <entry>top-aligned inherited from previous cell</entry>
    </row>

     [:)]

    Jonathan Dagresta
    RWS Group/
    XPP Development