Tables with Custom Header CSS for Word output

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
mikusss2
Posts: 8
Joined: Fri Jan 23, 2009 11:20 am

Tables with Custom Header CSS for Word output

Unread post by mikusss2 »

Hello,

I am wondering if the following is possible. I am trying to achieve a specific look of all tables for the purposes of Word export:

Image

Essentially, I need the header with a different color, without inner borders, with text property set to uppercase and a different color than the background. It's quite easy to achieve in CSS, but I am struggling to make it work as a style for tables in H&M, which I would prefer.

Currently, I am able to edit the XML source to achieve the beforementioned properties, but I am wondering if it is possible to somehow update the table style properties to set specific css styles for <thead>, firstchild <tr> or something like that?

Would it be possible to for example amend the following source styleclass to reflect these requirements? Or do this somewhere else in the hmxp source code?

Code: Select all

<tablestyleclass name="Default">
        <style-set media="screen">width:100%; cell-padding:4px; cell-spacing:0px; page-break-inside:avoid; border-width:0px; border-spacing:0px; border-collapse:collapse; cell-border-width:1px; border-color:#ffffff; border-style:solid; background-color:#f2f2f2; head-row-background-color:#009eb7; alt-row-background-color:none;</style-set>
      </tablestyleclass>
If there is any way to apply such style to tables conveniently from H&M, please let me know.

Thank you for your time!

Best Regards
Michal
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Tables with Custom Header CSS for Word output

Unread post by Tim Green »

Hi Michal,

I like the way you are approaching this. 8)

Unfortunately, this isn't possible. You can't use CSS because that won't get exported to DOCX, and you can't extend the XML without also changing the XML schema in the .xsd, and our policy is to only do that on major version changes. Otherwise we run the risk of breaking too many projects. I suggest you post a request for table handling and formatting in the Wish List section, which is always monitored by our developers.

However, there is a workaround you can use to get around this for the moment: Make a dummy table with the formatting you need applied manually, and save it as an XML snippet. That will effectively be your template. Then whenever you need to use a table like that you just insert the snippet with the snippet tool in copy/paste mode instead of as a linked snippet. See here for details on handling and managing snippets:

https://helpandmanual.com/help/index.ht ... ippets.htm
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
mikusss2
Posts: 8
Joined: Fri Jan 23, 2009 11:20 am

Re: Tables with Custom Header CSS for Word output

Unread post by mikusss2 »

Thanks for the suggestion, Tim, I will try that.
Post Reply