一个简单CSS问题:谢谢大家

IMPIG 2005-01-19 12:31:56
在HTML中有<table align="center">....</table>使表格居中显示
在STYLE.CSS中如何实现这样的效果啊
也就是让LIKE这个CSS文件的所有页面中所有表格相对于父级对象居中
我查了很久找不到,急用啊,谢谢大家
...全文
100 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
nchen123 2005-01-27
  • 打赏
  • 举报
回复
这个 expression 是只能用于 IE 的,注意不可滥用。
stefli 2005-01-19
  • 打赏
  • 举报
回复
table
{
margin-left:auto;
margin-right:auto;
}

可以看看web标准.
hackate 2005-01-19
  • 打赏
  • 举报
回复
呵呵,楼上的回答了正解!

顺楼上,我来个对子!

你好我好大家好我们都好!

呵呵
是是非非 2005-01-19
  • 打赏
  • 举报
回复
table {s:expression(this.align='center';);}
是是非非 2005-01-19
  • 打赏
  • 举报
回复
table {s:expression(this.align='center';);}
tylchina 2005-01-19
  • 打赏
  • 举报
回复
帮顶,我也想知道
IMPIG 2005-01-19
  • 打赏
  • 举报
回复
晕了

s:expression(this.align='center') 好用
xl1860 2005-01-19
  • 打赏
  • 举报
回复
替楼主测了下: eglic(圪圪)(国事家事天下事关我鸟事,风声雨声读书声我不作)

table {s:expression(this.align='center';);}


可行, 不过多了个;号

table {s:expression(this.align='center');}

可行-------------
IMPIG 2005-01-19
  • 打赏
  • 举报
回复
错了,这样也不行
----------------------------------------------
<html>
<head>
<style>
table {
border-collapse:collapse;
margin-left:auto;
margin-right:auto;
}
.table1 {
s:expression(this.align='center';)
}
</style>
</head>

<body>

<table width="500" border="1">
<tr><td>第一列</td><td>第二列</td></tr>
</table>

<br>

<table width="500" border="1" class="table1">
<tr><td>第一列</td><td>第二列</td></tr>
</table>

</body>
</html>

是IE出问题了吗?不会啊collapse是有效的啊
IMPIG 2005-01-19
  • 打赏
  • 举报
回复
谢谢大家,为什么无效啊
-------------------------------
<html>
<head>
<style>
table {
border-collapse:collapse;
margin-left:auto;
margin-right:auto;
}
.table1 {
s:expression(this.align='center';);
}
</style>
</head>

<body>

<table width="500" border="1">
<tr><td>第一列</td><td>第二列</td></tr>
</table>

<br>

<table width="500" border="1">
<tr><td>第一列</td><td>第二列</td></tr>
</table>

</body>
</html>
潜水的鱼 2005-01-19
  • 打赏
  • 举报
回复
替楼主测了下: eglic(圪圪)(国事家事天下事关我鸟事,风声雨声读书声我不作)

table {s:expression(this.align='center';);}


可行, 不过多了个;号

table {s:expression(this.align='center');}



潜水的鱼 2005-01-19
  • 打赏
  • 举报
回复
补充楼上:

网页头部需要是:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧