注册 登录
编程论坛 ASP技术论坛

如何给多个表格规定同一行高,列宽?

qjw9004 发布于 2011-09-18 17:30, 1369 次点击
我的页面中有两个什么样定义才使得两个表的行高,列宽都一样?谢谢~~
如:当我设置第一个表行高列宽后,第二个表也就跟着改了~~~

<body>
<div class="rightPanel">
            <div class="rightTop" id="rightTop">
                <div class="rightTitle">
                    <table width="800">
                        <tr height="30px">
                            <th width="3%">1</th>
                            <th width="3%">2</th>
                            <th width="3%">3</th>
                        </tr>
                        <tr height="30px">
                            <th width="3%">非固定A</th>
                            <th width="3%">非固定B</th>
                            <th width="3%">非固定C</th>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="rightContent" id="rightContent" onscroll="jscroll()">            
                <table width="800">
                    <tr height="30px">
                      <td width="3%">1</td>
                      <td width="3%">2</td>
                      <td width="3%">3</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                </table>
            </div>
        </div>
</body>
2 回复
#2
yms1232011-09-19 14:31
用css定义呢?
<style type="text/css">
.tableCls
{
   width:800px;
}
.tableCls tr
{
    height:30px;
}
</style>
<body>
<div class="rightPanel">
            <div class="rightTop" id="rightTop">
                <div class="rightTitle">
                    <table class="tableCls">
                        <tr>
                            <th width="3%">1</th>
                            <th width="3%">2</th>
                            <th width="3%">3</th>
                        </tr>
                        <tr>
                            <th width="3%">非固定A</th>
                            <th width="3%">非固定B</th>
                            <th width="3%">非固定C</th>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="rightContent" id="rightContent" onscroll="jscroll()">            
                <table class="tableCls">
                    <tr>
                      <td width="3%">1</td>
                      <td width="3%">2</td>
                      <td width="3%">3</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                </table>
            </div>
        </div>
</body>
#3
qjw90042011-09-20 21:51
对CSS不什么了解,能否做个最简单的实例呢?
谢谢了!~~
1