HTML Table


Is there a way of stopping people selecting a table on an HTML page?  at the moment I have some text in a table and you can select the whole table using the + handles.

Julian HainesSenior IT AdministratorAsked:
Who is Participating?
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.

James BilousSoftware EngineerCommented:
I'm not sure what you mean by + handles, but you can apply some css rules (which are browser dependent) on the container in order to stop selection:
you can convert that table into an image.

you can create a pseudo table using absolutely positioned divs and write the divs in random order so selecting is feasible but the order will be messy.

you can use pagination so only a few lines at a time can be selected

you can add a transparent modal div over the table : this is quite easy to circumvent for power users, but quite efficient if they are limited to easy copy-paste. that would be the easiest to implement by far.
Julian HainesSenior IT AdministratorAuthor Commented:
Thanks sounds good it just looks messy when you move over a table and the handle appear.

Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

James BilousSoftware EngineerCommented:
You can also change the mouse cursor to a pointer using CSS
if it just "looks messy" the modal is good enough by far. the css might also work, i'm unsure. but then you probably do not want to do this. different browsers will act differently. this is basically not html related.
Julian HansenCommented:
select the whole table using the + handles.

In which browser? Unless you have specifically coded this functionality or you are using a browser like the one that Excel uses to import data which recognises table and adds the borders and handle - this is not the default for most browsers.

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
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.