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 Link to comment https://forums.phpfreaks.com/topic/202929-get-table-height/ Share on other sites More sharing options...
priti Posted May 26, 2010 Share Posted May 26, 2010 with jquery $('#table_id').attr('height'); Link to comment https://forums.phpfreaks.com/topic/202929-get-table-height/#findComment-1063496 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. Link to comment https://forums.phpfreaks.com/topic/202929-get-table-height/#findComment-1063536 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.