日期:2014-05-16  浏览次数:20598 次

关于javascript控制div的css,有会的进来帮忙解决下,谢谢了,解决了立马结题




具体HTML部分代码如下:

<div id="divDept" style="position:fixed; left:568px; right:0px; bottom:0px; top:4px; width:198px; height:194px; margin:auto;">
<table id="tableDept" style="width:250px; height:160px; border-collapse:collapse; font-size:13px; color:#000;" border="0" align="center">
<tr>
<td id="deptTd" nowrap="nowrap" style="width:150px; height:135px; border-bottom:10px solid #39b4ee; border-top:10px solid #39b4ee; border-left:1px solid #39b4ee; border-right:1px solid #39b4ee; background-color:#fff;" rowspan="2">
<div style="width:150px; height:20px; border-bottom:1px solid #39b4ee;">部门名称</div><br/>
<div style="width:150px; height:115px;">123</div>
</td>
<td id="deptUserTd" nowrap="nowrap" style="width:60px; height:135px; border-bottom:10px solid #39b4ee; border-top:10px solid #39b4ee; border-left:0px solid #39b4ee; border-right:10px solid #39b4ee; background-color:#fff;" rowspan="2">
<div style="width:80px; height:20px; border-bottom:1px solid #39b4ee;">姓名</div><br/>
<div style="width:80px; height:115px;">123</div>
</td>
<td style="width:20px; height:65px; background-color:#39b4ee; border-bottom:10px solid #39b4ee; border-top:10px solid #39b4ee; border-left:0px solid #39b4ee; border-right:0px solid #39b4ee;" align="center" valign="top">
<span id="sDeptSpan" onclick="setsDeptSpanInnerHTML()" style="cursor:pointer;"><br/>所<br/>属<br/>部<br/>门</span>
</td>
</tr>
<tr><td style="width:20px; height:90px;"></td></tr>
</table>
</div>

------解决方案--------------------
在table那里加上 cellpadding="0" cellspacing="0"
------解决方案--------------------
你就用4个div
不就好了
上下一样的宽度 简单实用
------解决方案--------------------

table {
 border-collapse: collapse;
 border-spacing: 0;
}