Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
api to change table column width
snowch
I have a table that may have 4, 5, or 6 columns. I would like to use a single table with 6 columns and dynamically hide the columns that are not needed. The widths of the columns depend on how many columns the table displays, e.g.
widths if 4 cols = { 1.25, 1.25, 1.25, 1.25, 0.00, 0.00 } // last 2 cols hidden
widths if 5 cols = { 0.50, 1.00, 0.50, 1.00, 1.00, 0.00 } // last col hidden
widths if 6 cols = { 0.50, 1.00, 0.50, 1.00, 0.50, 0.50 } // all cols shown
Note that the widths represent absolute measurements (cm). I.e. if the table has 4 columns then the width of the first column is 1.25cm. However, if the table has 5 or 6 columns, the width of the first column is 0.5cm. I will decide how may columns the table needs depending on the value of a parameter.
Is it possible to change a table column width using the api? Or, do I need to create 3 different static variations of my table?
Many thanks in advance...
Find more posts tagged with
Comments
mwilliams
Hi snowch,
You could try using if/else statements on the cells and/or elements in the header row of your table to resize depending on the parameter. You would use the this.width = "1cm" script to change the width. I would think the table would inherit these values as their width as well. I have not tried this myself, so let me know if it works or not. Thanks.