Table resizing

I'm using a dataTables.net "ColVis" extension and just had a question about table reorder.
The "ColVis" gives the user the ability to select/deselect columns they would like to see in a table.
My Question: Is it possible to resize the table as the columns are being added or removed?

Here's my SharePoint site with it being implemented. (click the "show/hide" button)
http://isaac.issharepoint.com/ICTT/Shared%20Documents/modalTable.aspx
LVL 5
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rainer JeschorCommented:
Hi,
what do you mean with resizing the table?
Currently the table is set to 100% width, therefore the (remaining) columns take all the available space.

Here is a generic sample how to set the table (and/or) column widths:
http://jsfiddle.net/EE_RainerJ/zxr7nLh0/

HTH
Rainer
0
Rainer JeschorCommented:
BTW - there is no data shown as the site asks for credentials.
0
IsaacSharePoint Client Side DeveloperAuthor Commented:
So, I am trying to implement the ColVis extension of datatable.net. It provides a 'show/hide' button and when clicked, it shows a small panel listing the column names of the table with checkboxes next to them. It allows you to select or deselect columns you want to see or not. When columns are deselected, the table width stays the same and does not resize.
So if I had 10 columns and deselected 9, the width is stays the same and does not resize to the 1 column remaining.
I need the table to resize.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

IsaacSharePoint Client Side DeveloperAuthor Commented:
Here's my fiddle as an example.  Click on the "Show/hide columns" button
As you will see, once they select columns to remove, the table does not resize.  I want to be able to resize the table as the columns are hidden.

http://jsfiddle.net/isogunro/zxr7nLh0/11/
0
Rainer JeschorCommented:
Hi,
here we go:
http://jsfiddle.net/EE_RainerJ/ej6hn6yf/

Changes:
- Set the property autowidth of the datatable to false
- remove the width of the table in HTML
- override the CSS class table.dataTable and set width: auto

HTH
Rainer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IsaacSharePoint Client Side DeveloperAuthor Commented:
Awesome! Thank you so much.  
I have a few other dataTable issues that I will post a little later.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.