It seems that opening the table dialog box without taking into account the height parameter during initialization would be by design. My experience is that jQuery UI components behave most sequentially, wrapped as <div>
elements, and it looks like you found the same result, but as you said, this should not be a requirement.
The default value for the height parameter in the dialog box () is auto
, which should scale the dialog box according to the element. Perhaps there is an error when the table
element is passed to dialog()
, forcing auto
override the height parameters in init. I tried to change the width value in the first example, and dialog()
answered correctly by changing the width, but the height did not budge. I also reordered the parameters so that the height was first, but that also had no effect.
JS Bin doesn't work well for me, so I moved your code to this fiddle and squeezed the init dialog call. https://jsfiddle.net/z601hhjd/
// Open dialog and set height and width on init // Width option works at initialization but height does not $(".shortTable").dialog({ 'height':'300', 'width':'500', open: function(event, ui) { // Height setter has no effect after init either $(this).dialog("option", "height", 200 ); // Width setter works after initialization too $(this).dialog("option", "width", 200 ); } });
It seems like there is an error in jQuery UI for setting the height on table
elements that conflict with the documentation , but this functionality is in accordance with the HTML specifications, as @Peri said.
source share