如何通过设置CSS,让表格居中?

ttyp 2004-08-15 11:40:24
RT
...全文
452 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
张海霖 2004-08-15
  • 打赏
  • 举报
回复
<style type="text/css">
<!--
.com {
align="center"
}-->
</style>
这是什么啊,
因该是
<style type="text/css">
<!--
.com {
text-align:center;
}-->
</style>
ttyp 2004-08-15
  • 打赏
  • 举报
回复
关键是还要离顶10单位
style="position:absolute;width:98;top:10px"
然后居中
xzq686 2004-08-15
  • 打赏
  • 举报
回复
<style type="text/css">
<!--
.com {
align="center"
}-->
</style>

<table name="table1" class="com">
</table>
ttyp 2004-08-15
  • 打赏
  • 举报
回复
.commandBar
{
position:absolute;
top:10px;
left:expression(document.body.offsetWidth*0.01);
width:98%;
}
ttyp 2004-08-15
  • 打赏
  • 举报
回复
呵呵,看来只能是这个了
whnnet 2004-08-15
  • 打赏
  • 举报
回复
可以参考

http://www.blueidea.com/bbs/archivecontent.asp?id=434909

http://www.yesky.com/SoftChannel/72351167954354176/20030714/1713928.shtml
http://www.dalianit.com/edu/%7B78.85.108.54.79.104.62.62%7D.html
whnnet 2004-08-15
  • 打赏
  • 举报
回复
有些属性不能些css里的,可以用expression进行控制的啦
超级大笨狼 2004-08-15
  • 打赏
  • 举报
回复
<style>
table
{
align:center;
}
</style>

所有表格居中
xzq686 2004-08-15
  • 打赏
  • 举报
回复
晕。 btut2004谢谢你的批评。。
xzq686 2004-08-15
  • 打赏
  • 举报
回复
<style type="text/css">
<!--
.com {
top: 10px;
text-align:center
}-->
</style>

<table name="table1" class="com">
</table>
ttyp 2004-08-15
  • 打赏
  • 举报
回复
不是文本居中,是整个表格居中
whnnet 2004-08-15
  • 打赏
  • 举报
回复
table,td {text-align:center}

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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