robert_gsfame Posted May 26, 2010 Share Posted May 26, 2010 how can i retrieve the table height and put it into textbox so any changes of table height will be caught and appear in textbox Quote Link to comment Share on other sites More sharing options...
priti Posted May 26, 2010 Share Posted May 26, 2010 with jquery $('#table_id').attr('height'); Quote Link to comment Share on other sites More sharing options...
Adam Posted May 26, 2010 Share Posted May 26, 2010 "so any changes of table height" - there's no standard event that will allow you to automatically do this. Instead you'll need to identify what can cause changes in the height, and bind a function to an appropriate event there (or to several elements). @priti I think you mean .css('height'), but better is .height() -- the latter returning a unit-less pixel value. Using standard JavaScript makes this a lot more awkward, but you may have some look with .clientWidth/.clientHeight or .scrollWidth/.scrollHeight. The only problem being the differences between browsers make them very hard to work with reliably. If you're already using jQuery (or another framework) I'd definitely use the built-in functions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.