Sometimes tables gives pain in the neck compared to divs. I needed to replace a table made with rounded corners using images to be replaced by a div tag because dojo Tree widget start going woo hoo with the table. Thus I created a table with rounded corners which got rid of problems with tree widget. But initially I couldn't center the table as there were no css attribute to center the div element. If you know the width of the div you are messing with there is a way to do this using css without the use of javascript!
So if you come across a situation to center the table horizontally here is the style to do it
#centered{
position: relative;
left: 50%;
width:600px;
margin-left:-300px;
}
No comments:
Post a Comment