Link to home
Start Free TrialLog in
Avatar of sumachaa
sumachaa

asked on

Change table column width

hi all

i need to change the column width of a table dynamically...

eg: i have created a table with some rows and columns... and then i need to change the column width by dragging the column border.....

Can anyone help me in this .. :-)

Sumesh
Avatar of ziffgone
ziffgone
Flag of Canada image

Hi sumachaa, for 50 points on such a complicated question, I'll point you towards a similar question:

https://www.experts-exchange.com/questions/21074126/How-to-move-this-into-for-example-a-table-cell-or-just-move-it-to-another-place-on-the-page.html

And for end result:

https://www.experts-exchange.com/questions/21076895/Position-relative-table-problem.html

mplungjan seems to be working on something similar. Not sure how you'll integrate it into what you are doing, but all of the workings are there.

Regards...
Avatar of mmayrell
mmayrell

I tried something similier to this before, and I found it very hard to actualy select the border, what I had to do was set up a table with a very skinny column, not much wider than a normal column(just take off all padding and put a space in it with a very small font 1px)  then you can just use the on mouse down function.

at this point just grab the window.clientY and then on mousemove just set the width on the left hand cell to match the window.clientY - cells left offset.  this should do it, just make sure you don't have a width in the right hand cell.

if you raise the point up I could try to write some of the actual code for you.

-Michael
ASKER CERTIFIED SOLUTION
Avatar of ziffgone
ziffgone
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial