日期:2014-05-17 浏览次数:20791 次
<!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" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>test-csdn-table</title>
    <style type="text/css">
        .data_show{border-collapse:collapse; border:1px solid #ccc;}
        .data_show th{ background:#E5ECF9;}
        .data_show td{ background:#E5ECF9; padding:3px; text-align:left;}
    </style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="100%" >
    <tr>
        <td width="10%">用户名:</td>
        <td width="15%">
            <input type="text" value="" name="userids" id="userids" />
        </td>
        <td><input type="submit" style="width:60px; height:18px;" value="查询" id="search" class="button2" name="search" /></td>
    </tr>
</table>
</body>
</html>
------解决方案--------------------
不懂楼主要干啥?把TD里边的内容居左,你这个TR的宽度是多少?没具体说明,就只写了个table宽度100%,行的宽度没限制,而td的单位有用px这显得杂乱无章了点,单位必须统一,不然不一样的浏览器分辨率不一样。