Html 如何将a<;表>;

Html 如何将a<;表>;,html,css,center,css-tables,Html,Css,Center,Css Tables,我有以下css: table.toe { border: 1px solid black; width: 80%; margin-left:auto; margin-right:auto; } table.toe td { border:1px solid black; text-align: center; font-size: 24px; } 我知道这会影响我的工作表,因为宽度和td样式都存在并且可以修改。但是桌子本身卡在屏幕的左侧,我希望它居中 我正在使用I

我有以下css:

table.toe {
  border: 1px solid black;
  width: 80%;
  margin-left:auto; 
  margin-right:auto;
}
table.toe td {
  border:1px solid black;
  text-align: center;
  font-size: 24px;
}
我知道这会影响我的工作表,因为宽度和td样式都存在并且可以修改。但是桌子本身卡在屏幕的左侧,我希望它居中

我正在使用IE9


谢谢

除非您正在使用,否则自动边距将使表格居中,这将导致IE 9模仿IE 5

确保以Doctype开始HTML文档。HTML5通常是一个不错的选择

<!DOCTYPE html>


也可以通过运行代码。

请添加一个Fiddle。您可以添加堆栈片段或Fiddle吗?忘记标记了。一旦添加,它就解决了问题。谢谢!