JohnSearle
September 24th, 2008, 10:35 AM
I'm currently trying to determine the left and top positions of a table cell that is currently set to 'auto' (as opposed to 'absolute').
I can determine this by:
leftPos = element.style.left;
topPos = element.style.top;
when the element is an absolute position, but when it is set to auto it returns nothing. Is there anyway of determining this?
I just attempted to nest a 'div' inside the cell with an undefined absolute position, hoping that it would be by default set by the parent cell, but it seems to have overridden the auto placement instead.
EDIT: I should also note, the reason why I have it set to auto is because I want to centre the entire document. If there was a way to centre the elements (similar to a center tag), but use absolute positioning so the left and top properties contain a value, then that would be good too.
Thanks for any help.
- John
I can determine this by:
leftPos = element.style.left;
topPos = element.style.top;
when the element is an absolute position, but when it is set to auto it returns nothing. Is there anyway of determining this?
I just attempted to nest a 'div' inside the cell with an undefined absolute position, hoping that it would be by default set by the parent cell, but it seems to have overridden the auto placement instead.
EDIT: I should also note, the reason why I have it set to auto is because I want to centre the entire document. If there was a way to centre the elements (similar to a center tag), but use absolute positioning so the left and top properties contain a value, then that would be good too.
Thanks for any help.
- John