Long time no code, recently a new project, began to record their own development process encountered some problems.
On the display and hiding of JS control tr
The first thing to do is:
<tr id= "att" style= "display:none;" >
<TD style= "text-align:right;" > Accessory File:</td>
<td>
<div id= "Div_fujian" >
<div class= "Input-outer" ><input type= "file" class= "Tuitrim input" name= "Fujian" size= "MaxLength" = "Id=" "Fujian" tabindex= "1"/></div>
</div>
<input type= "button" id= "BTN_ADD2" value= "Add Attachment" >
</td>
</tr>
js Method: Function setdetailmsgrow (Rowid,sel) { var row = document.getelementbyid (RowID); if (Row != null) { if (sel.value == 0) { row.style.display = " Block "; } else { row.style.display = "None"; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;}&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;}&NBSP: But at the end of the day, when we look at the effect, we find that there will be dislocation. , such as
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8B/90/wKiom1hRBJXCfiT2AAArHo_V1kU183.png-wh_500x0-wm_3 -wmp_4-s_1292911146.png "title=" 123.png "style=" WIDTH:500PX;HEIGHT:444PX; "width=" "height=" 444 "border=" 0 " Hspace= "0" vspace= "0" alt= "wkiom1hrbjxcfit2aaarho_v1ku183.png-wh_50"/>
Control display of the TR appears, there has been a dislocation phenomenon, to find the cause, as follows:
The use of display = block will become blocks of elements, such settings will change the layout of the page, so it will be misplaced;
Then how to set up, can realize the JS control tr display and hide it,
You can change the display property to Table-row
For Table-row's instructions like, you can learn, I learned
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/91/wKiom1hRBebCf7DYAACKyp4t398735.png-wh_500x0-wm_3 -wmp_4-s_1832477583.png "title=" 243.png "alt=" Wkiom1hrbebcf7dyaackyp4t398735.png-wh_50 "/>
This article is from the "butcher36" blog, make sure to keep this source http://butcher36.blog.51cto.com/9315484/1882726
JS Control tr Display and hide