none
Why are the table styles for lastRow/lastColumn ignored RRS feed

Answers

  • Hi Dave,

    I think I understand this, see if it makes sense to you. I can dig further if this doesn't make sense. The first row is also the *only* row in this case. If we remove the formatting for color on the run then Word doesn't consider it to be the last row. It just moves on to the next precedent in style application. If I add another row like this: Added second row which picked up lastRow formatting.

    ...then there is a lastRow and it picks up the lastRow formatting.

    Tom

    • Marked as answer by DavidThi808 Monday, July 27, 2015 5:33 PM
    Monday, July 27, 2015 12:17 AM
    Moderator
  • Ok, Word is applying the tblStylePr sections properly. The tblLook mask, by default, is telling it to apply firstRow and lastCol. Other sections are not applied because the tblLook mask has them turned off. With this knowledge and omitting firstRow properties, we can see that Word moves on to apply lastCol. We can verify this by changing the w:shd element attributes, specifically the w:fill attribute. If I modify lastCol's fill color to 0x0000FF, I get blue background. The run text color is background1 which is lt1 or white. Modify lastCol's fill color to convince yourself this is true (say, 0x00AAFF) which is a lighter blue.

    You can add the tblLook element to the table in the document.xml part like this:

    <w:tblLook w:firstRow="true" w:lastRow="true" w:noHBand="true"...

    ... to get other tblStylePr sections to be applied.

    Make sure you check out [MS-OI29500] 2.1.159 for the default value of tblLook. It's different than the standard.

    Let me know if this doesn't make sense to you.

    Tom


    Thursday, July 30, 2015 12:26 AM
    Moderator
  • To clarify, your sample docx file doesn't have the tblLook element. I was trying to explain that it defaults (see [MS-OI29500]) to values that caused Word to use the lastCol style. I mentioned the addition of tblLook to show that you can control which tblStylePr's Word will use by changing that mask.

    Tom

    • Marked as answer by DavidThi808 Thursday, July 30, 2015 4:45 PM
    Thursday, July 30, 2015 4:22 PM
    Moderator

All replies

  • Hi David,

    Thank you for your question.  An engineer from the Protocols team will contact you soon.


    Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team

    Saturday, July 25, 2015 5:10 AM
    Moderator
  • Hi Dave,

    I will look into this and get back to you shortly.

    Best regards,
    Tom Jebo
    Microsoft Open Specifications

    Sunday, July 26, 2015 7:01 AM
    Moderator
  • Hi Dave,

    I think I understand this, see if it makes sense to you. I can dig further if this doesn't make sense. The first row is also the *only* row in this case. If we remove the formatting for color on the run then Word doesn't consider it to be the last row. It just moves on to the next precedent in style application. If I add another row like this: Added second row which picked up lastRow formatting.

    ...then there is a lastRow and it picks up the lastRow formatting.

    Tom

    • Marked as answer by DavidThi808 Monday, July 27, 2015 5:33 PM
    Monday, July 27, 2015 12:17 AM
    Moderator
  • Hi Tom;

    Ok, that does seem to fit. Doesn't match the spec but it is reasonable.

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Monday, July 27, 2015 5:32 PM
  • Actually, before concluding, I just remembered that I didn't consider the tblLook mask element. I need to check that against what is being applied and make sure the explanation is correct.

    I'll get back to you when I've had a chance to do more testing.

    Tom

    Monday, July 27, 2015 8:01 PM
    Moderator
  • Ok, Word is applying the tblStylePr sections properly. The tblLook mask, by default, is telling it to apply firstRow and lastCol. Other sections are not applied because the tblLook mask has them turned off. With this knowledge and omitting firstRow properties, we can see that Word moves on to apply lastCol. We can verify this by changing the w:shd element attributes, specifically the w:fill attribute. If I modify lastCol's fill color to 0x0000FF, I get blue background. The run text color is background1 which is lt1 or white. Modify lastCol's fill color to convince yourself this is true (say, 0x00AAFF) which is a lighter blue.

    You can add the tblLook element to the table in the document.xml part like this:

    <w:tblLook w:firstRow="true" w:lastRow="true" w:noHBand="true"...

    ... to get other tblStylePr sections to be applied.

    Make sure you check out [MS-OI29500] 2.1.159 for the default value of tblLook. It's different than the standard.

    Let me know if this doesn't make sense to you.

    Tom


    Thursday, July 30, 2015 12:26 AM
    Moderator
  • Hi Tom;

    I just downloaded the file I listed above (to make 100% certain I'm looking at the same file). It does not have a tblLook element in either style.xml or document.xml. Should I be looking elsewhere?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Thursday, July 30, 2015 2:20 PM
  • To clarify, your sample docx file doesn't have the tblLook element. I was trying to explain that it defaults (see [MS-OI29500]) to values that caused Word to use the lastCol style. I mentioned the addition of tblLook to show that you can control which tblStylePr's Word will use by changing that mask.

    Tom

    • Marked as answer by DavidThi808 Thursday, July 30, 2015 4:45 PM
    Thursday, July 30, 2015 4:22 PM
    Moderator