I am generating pdf and word documents. In that displaying the tables using html tags. columns will be different for each records. I want to set width of the column based list count. If list have 3 records i want to display 3 coulumns fit in the table width.(means table width is 100%, then column width should be 100/3). If list has 5 records i want to display 4 columns(here column width should be 100/4). max 7 records. How to set the width dynamically..?
[SalesForce] How set table width dynamically based on list count
Related Solutions
I found an easy solution for the problem, no need to implement any logic for the same just included the following attribute -fs-table-paginate: paginate;
in tables style tag and worked like a miracle.
Best Answer
You can simple check the number of rows in your controller and calculate width .
for ex:
And then use this variable in you VF/HTML. for ex.