html - JQuery resizable changes column width in IE11 -
i got table placed in div. table consists of header 2 columns , 1 row colspan of 2. elements inside td's , th's div's , input fields. row takes 100% of table width, first header column uses 90% of width , second column uses whatever has left. got jquery's resizable applied first column in header , table's row. works in firefox, doesn't in ie11. start resizing div in table's row, header's column widths automatically resize 50% no matter what. why happening? here example code:
function applyresizable(element) { element.resizable({ resize: function(event, ui) { ui.size.width = ui.originalsize.width; } }); console.log(element); $(".ui-resizable-handle.ui-resizable-e").remove(); } $(document).ready(function() { applyresizable($(".resizable")); });
body textarea { resize: vertical; margin: 0; overflow: none; box-sizing: border-box; } th.th-question-container { width: 90%; } div.with-borders { border-style: solid; border-width: 1px; padding: 1em; } div.legal-page-div { width: 100%; height: 850px; margin-bottom: 10px; vertical-align: top; position: relative; } div#legal-page-div-wrapper { position: relative; width: 80%; padding-bottom: 10px; padding-top: 10px; } table { position: absolute !important; width: 93% !important; border: 0px none; border-spacing: 0px; font-size: 0.857em; margin: 10px 0px; border-collapse: collapse; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <link href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" /> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <div id="legal-page-div-wrapper" class="form-wrapper"> <div class="with-borders legal-page-div form-wrapper" id="legal-page-div-1"> <table id="q1"> <thead> <tr> <th class="th-question-container"> <div class="question-div with-borders resizable form-wrapper" id="edit-q1" contenteditable="true"></div> </th> <th> <div class="form-item form-type-textfield form-item-w1"> <input id="edit-w1" name="w1" value="" size="2" maxlength="2" class="form-text" type="text"> </div> </th> </tr> </thead> <tbody> <tr> <td colspan="2"> <div class="with-borders answer-div resizable form-wrapper" id="edit-a1" contenteditable="true"></div> </td> </tr> </tbody> </table> </div> </div>
thanks in advance.
appears adding
table { table-layout:fixed; }
fixes problem in browsers
Comments
Post a Comment