第一部分
<!-- 題幹 -->
<tr>
<td width="15%" align="right" >題目內容 </td>
<td width="55%" align="left">
<textarea id="proContent" name="proInfo.proContent" rows="35" style="width:99%;height:180px; border: 1px solid #c5c5c5"></textarea>
</td>
<td align="center">
<img alt="題乾圖片" id="problemImg" name="problemImg" src="" style="width:220px;height: 155px;"><br><br>
<span id="spanContent">
<a href="javascript:selectImg('proImg','problemImg','spanContent')" title="插入圖片" >插入圖片</a>
</span>
<a href="javascript:deleteImg('taimg')">刪除圖片</a>
</td>
</tr>
<!-- 題幹 -->
第二部分
<!-- 選擇題 start -->
<tr id="txtChoiec">
<td width="15%" align="right">題目選項
<br>
<br>
<input type="button" value="增加選項" onclick="addTab()">
</td>
<td width="75%" align="left" colspan="2">
<div><input type="radio" name="optionType" value="1" checked="checked" onclick="changeXz(this.value)">單項選題
<input type="radio" name="optionType" value="2" onclick="changeXz(this.value)">多項選題
<span id="optionTypeDiv" style="color: red"> 單項選擇題,只能勾選一個答案</span>
</div>
<table id="chooseDiv" border="0" width="100%">
<tr>
<td width="30"><input type="checkbox" name="optCheck" value="A" onclick="showChoose(this.value)">A</td>
<td width="400"><textarea rows="35" style="width:100%;height:36px;" id="option1" name="proInfo.option1"></textarea></td>
<td width="130"><img alt="選項圖片" id=optionImg1 name="proInfo.optionImg1" src="" style="width:120px;height: 45px;"></td>
<td width="70">
<span id="span1">
<a href="javascript:selectImg('opimg1','optionImg1','span1');" title="插入圖片">插入圖片</a>
</span>
<br> <br>
<a href="javascript:deleteImg(tbimg)">刪除圖片</a>
</td>
</tr>
</table>
</td>
</tr>
<!-- 選擇題 end -->
在火狐firfox瀏覽器,第二部分 colspan=2貌似沒有其左右,很少鬱悶。後來調試發現是和display屬性有關係。
解決方法:
如果在<table>中對<tr>或者<td>使用style.display來控制顯示/隱藏某行或某個單元格的話,在IE中一切正常,但是在Firefox中就會出現錯位的現象。
解決方法是把style.display='block'
寫成
style.display= “ ” //爲空就行。
'就可以了
本人遇到這個問題,並實踐上面過程。