你是不是给你的 table 定宽了? 若是定宽了的话, 就会引发 table 自动调整列宽

解决方案 »

  1.   

    原代码:
    <%@ page contentType="text/html;charset=gb2312"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.util.*"%>
    <!-- when the document mousemove, judge whether is dragging, then change the display of the dragging event -->
    <body leftmargin="0" topmargin="0" onmousemove="" onmouseup="">
    <div id="functionbuttons" style="visibility:visible;position:absolute;top:0;left:30;">
    <!--
    This div is the Function Button Panel
    -->
    <font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add function buttons here.</font>
    </div>
    <!--
    This line object is the virtual display
    -->
    <img src="images/vertial.gif" id="line" style="position:absolute;visibility:hidden;">
      

  2.   

    <table id="maintable" style="position:absolute;top:30;left:50;visibility:visible;" border="0" cellpadding="0" cellspacing="0">
    <!--
    This table is the main table of the form, represents the form style
    -->
    <tr style="height:20">
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;">&nbsp;</td>
    <td align="center" style="background-color:menu;border:gray 1px solid;width:100;" oncontextmenu = "return false;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列1</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列2</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列3</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列4</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列5</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列6</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列7</nobr></b></td>
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid;width:100;" onmousemove="headerMouseOver(true);" onmousedown="headerMouseDown(true);" onmouseup="headerMouseUp(true);" onmouseout="headerMouseOut(true)"><b><nobr>列8</nobr></b></td>
    </tr>
    <tr style="height:20">
    <td align="center" oncontextmenu = "return false;" style="background-color:menu;border:gray 1px solid" onmousemove="headerMouseOver(false);" onmousedown="headerMouseDown(false);" onmouseup="headerMouseUp(false);" onmouseout="headerMouseOut(false)"><b>行1</b></td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    <td oncontextmenu = "return false;" style="border:gray 1px solid;">&nbsp;</td>
    </tr>