Column Headings in Table Command Input

Column Headings in Table Command Input

ebunn3
Advocate Advocate
989 Views
6 Replies
Message 1 of 7

Column Headings in Table Command Input

ebunn3
Advocate
Advocate

Hi,

 

Can anyone tell me if it is possible to put in column headings on a Table Command Input?  In this case something like:

Part Name, Area , Static Stress

On the background of the form and over the columns.

 

ebunn3_0-1632235450670.png

 

Thanks,

Eric

0 Likes
Accepted solutions (2)
990 Views
6 Replies
Replies (6)
Message 2 of 7

BrianEkins
Mentor
Mentor
Accepted solution

There isn't the concept of a header row in a Table command input.  It provides a way of organizing other command inputs into rows and columns.  One option is to add either a StringValueCommandInput or TextBoxCommandInput to each column in the first row and it would have the heading text.  It can be a different font and centered to make it stand out from the text in the rest of the table. 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 7

ebunn3
Advocate
Advocate
Thanks
0 Likes
Message 4 of 7

ebunn3
Advocate
Advocate

Brian,

 

Can you give me a hint on how one would manipulate the font using addStringValueInput?  I don't see properties for font, alignment, etc.

 

Eric

0 Likes
Message 5 of 7

BrianEkins
Mentor
Mentor
Accepted solution

I did a little testing to confirm what I told you and found you need to use TextBoxCommandInputs for the headers because they support HTML formatting for the string.  Using this can you define the text and formatting.  For example, here's the code I used to create one of the text boxes that I added to the table for the header.  It's the third argument that is setting it as center justified, a larger font, and bold.  The last argument is making it read-only.

 

col1HeaderInput = inputs.addTextBoxCommandInput('col1Header',
        'Col 1 Header',
        '<div align="center", style="font-size:12px"><b>Column 1</b></div>', 
        1, True)

 

Here's the resulting dialog.

 

HeaderSample.png

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 6 of 7

ebunn3
Advocate
Advocate

Thank you again Brian. I’ll try this out!!

 

Eric

0 Likes
Message 7 of 7

ebunn3
Advocate
Advocate

The formatting worked for me.  Here is the form.  I made the header row into it's own table so I could control the transparency.

 

Eric

 

ebunn3_1-1632314336174.png