table里只要设置align="center"就行了 DIV里没有属性可以控制其位置,只能通过CSS margin:0px auto; 当设置margin的左边距和右边距为自动时。左边距和右边距将会相等,即达到居中的效果。