Drag a table column to change the column width of the table, and use JavaScript scripts to add it to favorites! See the following Code ... < Html >
< Head >
< Meta HTTP - Equiv = " Content-Type " Content = " Text/html; charset = gb2312 " >
< Style >
. Resizedivclass
{
Position: relative;
Background-Color: red;
Width:2;
Z-Index:1;
Left: expression (This. Parentelement. offsetwidth-1);
Cursor: E-Resize;
}
</ Style >
< Script Language = Javascript >
Function Mousedowntoresize (OBJ) {
OBJ. mousedownx=Event. clientx;
OBJ. parenetdw=OBJ. parentelement. offsetwidth;
OBJ. parenetablew=Theobjtable. offsetwidth;
OBJ. setcapture ();
}
Function Mousemovetoresize (OBJ) {
If ( ! OBJ. mousedownx) Return False ;
VaR Newwidth = OBJ. parenetdw * 1 + Event. clientx * 1 - OBJ. mousedownx;
If (Newwidth > 0 )
{
OBJ. parentelement. style. Width=Newwidth;
//Theobjtable. style. width = obj. parenetablew * 1 + event. clientx * 1-obj.mousedownx;
}
}
Function Mouseuptoresize (OBJ) {
OBJ. releasecapture ();
OBJ. mousedownx=0;
}
</ Script >
</ Head >
< Body >
Drag a table column to change the column width of the table.
< Table ID = Theobjtable Style = " Table-layout: fixed " >
< Tr bgcolor = Cccccc >
< TD valign = Top >
< Font class = " Resizedivclass " Onmousedown = " Mousedowntoresize (this ); "
Onmousemove = " Mousemovetoresize (this ); " Onmouseup = " Mouseuptoresize (this ); " > </ Font >
Column 1 </ TD >
< TD valign = Top >
< Font class = " Resizedivclass " Onmousedown = " Mousedowntoresize (this ); "
Onmousemove = " Mousemovetoresize (this ); " Onmouseup = " Mouseuptoresize (this ); " > </ Font >
Column 2 </ TD >
< TD valign = Top >
< Font class = " Resizedivclass " Onmousedown = " Mousedowntoresize (this ); "
Onmousemove = " Mousemovetoresize (this ); " Onmouseup = " Mouseuptoresize (this ); " > </ Font >
Column 3 </ TD >
</ Tr >
< Tr >
< TD > Drag a table column to change the column width of the table. </ TD > < TD > Drag a table column to change the column width of the table. </ TD > < TD > Drag a table column to change the column width of the table. </ TD >
</ Tr >
</ Table >
</ Body >
</ Html >