Jump to content
Sign in to follow this  
misc_bb

Dynamic approach to building OOXML tables

Recommended Posts

Hi, just need some advise here.

 

I working on OOXML for Docx file creation. so far its all good but when it comes to tables there are just too many settings to be configured to get our desired table look.
I wanted to make this more dynamic and I'm thinking utilizing a TDictionary to handle and table style and the corresponding table configuration. Would this be a good option?

Example table settings:

<w:tbl>
            <w:tblPr>
                <w:tblStyle w:val="TableGrid"/>
                <w:tblW w:w="9648" w:type="dxa"/>
                <w:tblBorders>
                    <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
                    <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
                    <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
                    <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
                    <w:insideH w:val="none" w:sz="0" w:space="0" w:color="auto"/>
                    <w:insideV w:val="none" w:sz="0" w:space="0" w:color="auto"/>
                </w:tblBorders>
                <w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
            </w:tblPr>
</w:tbl>

MyDictionary : TDictionary<string, TTableProperties>;

//TTableProperties - Record or maybe an object

Honestly I'm new with TDictionary will this option be feasible?

 

Thank you!

Edited by misc_bb

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×