如何用CSS来限制表格宽度

来源:百度知道 编辑:UC知道 时间:2024/05/05 20:14:03
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表格测试</title>
<style>
#tttt td{border:solid; border-color:#0066FF; border-width:3px; background-color:#CCCCCC; width:20px; height:20px}
#tttt td:hover{ background-color:#00FF00; cursor:pointer}
</style>
</head>

<body>
<table id='tttt'>
<?php
for ($i=0;$i<10;$i++){
echo ('<tr>');
for ($ii=0;$ii<10;$ii++){
echo

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>表格测试</title> 
<style> 
#tttt td{border:solid; border-color:#0066FF; border-width:3px; background-color:#CCCCCC; width:20px; height:20px} 
#tttt td:hover{ background-color:#00FF00; cursor:pointer} 
</style> 
</head> 
 
<bo