请教css 表格居中;谢谢!
来源:百度知道 编辑:UC知道 时间:2024/05/19 13:06:09
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>表格布局08 8.12</title>
<style type="text/css">
<!--
table {
margin:0 auto;
text-align: center;
}
-->
</style>
</head>
<body>
<table width="767" height="122" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="180"><p> </p>
<p> </p></td>
<td width="584" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="103"> </td>
</tr>
<tr>
<td><table width="100%&q
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>表格布局08 8.12</title>
<style type="text/css">
<!--
table {
margin:0 auto;
text-align: center;
}
-->
</style>
</head>
<body>
<table width="767" height="122" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="180"><p> </p>
<p> </p></td>
<td width="584" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="103"> </td>
</tr>
<tr>
<td><table width="100%&q
哪里有水平线。。。。。。
-------------------------------
1.在你的table外面加一个<div style="text-align:center"></div>
也就是在你的<body>里面加上这个东西
2.修改你的style定义.把table的text-align值改为left
<style type="text/css">
<!--
table {
margin:0 auto;
text-align: left;
}
-->
</style>
完整的代码是
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>表格布局08 8.12</title>
<style type="text/css">
<!--
table {
margin:0 auto;
text-align: left;
}
-->
</style>
</head>
<body>
<div style="text-align:center "><table width="767" height="122" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="