Two HTML tables side by side, centered on the page

前端 未结 10 1699
小蘑菇
小蘑菇 2020-12-25 12:10

I have two tables on a page that I want to display side by side, and then center them within the page (actually within another div, but this is the simplest I could come up

10条回答
  •  粉色の甜心
    2020-12-25 12:17

    I realize this is an ancient question, but here goes anyway.

    The following will work in compliant browsers and IE8 in standards mode (i.e. with a doctype set).

    #inner {text-align:center;}
    .t {display:inline-block;}
    

    Unfortunately, there's really no way to tweak it to work in IE6. For IE7, adding a zoom:1 to the .t divs (via a conditional comment) might help, but I don't have IE7 available for testing at the moment.

提交回复
热议问题