Msg#: 4308652 posted 9:20 am on May 6, 2011 (gmt 0)
Hello, I have a script on my web page which I need aligning at the top of a table, I can only align it to the right or left. I'm currently using <div style="float: right"> as the code to align to the right. Can anybody help me move this to the top of the table? With or without a DIV tag?
Msg#: 4308652 posted 6:08 pm on May 6, 2011 (gmt 0)
welcome aboard cliffy_x, don't have time to code it out and test but I'd try setting position:relative on the table cell and try position: absolute; top:0; right:0; on the div. You may not need the relative positioning on the cell but for non-table elements you do, so that the absolutely positioned child will stay within the parent.
Msg#: 4308652 posted 9:13 pm on May 6, 2011 (gmt 0)
Hello rocknbill, thanks for your reply! I have tried those 2 codes you gave me but it doesn't work for this specific table cell, there is nothing else in there, only the script inside the div. If apply the position:relative to the actual table the div aligns right at the top, but it won't work for the cell, if that makes sense.