Hidden Columns

Hi Experts,

Is it possible within a HTML table to have a group of columns hidden using a CSS class that would contain some info for my JS, or would it be better to build a completely separate table within a div, because the user table must be a specific width?

Thank you
APD TorontoSoftware DeveloperAsked:
Who is Participating?

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

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.

Marco GasiFreelancerCommented:
Forgive me, but your question sounds strange to me. If your JS needs some data you can put them where you want accordingly to your JS or you can edit your JS to make it find your data wherever they be.
Anyway, I'd choose to build another table or another container (depending on the nature of the data and the code of the JS). Since tables goal is to show data to the user and since you want those date are hidden to the user, you can use whatever container you're more comfortable with to hold them.
Rainer JeschorCommented:
do you want to hide a complete column? Should the user be able to show the column again?
What kind of JavaScript do you use? Plain, jQuery, ...?
There is a jQuery plugin called datatables.net which has also an extension to select the visible columns.
Sample here:
The jsFiddle is not yet perfect in the styling but should give you some idea.


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
Steve BinkCommented:
To expand on a point implied by Rainer Jeschor's comment, if the data will *always* be hidden, why not create these data points solely within Javascript?  There's no need to have elements on the page if they will never be used.
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

From novice to tech pro — start learning today.