0

i am using div tag which is inside td element. I am getting values runtime from dwr[direct web remoting] which uses ajax calls and set the height and width of div element. Setting and getting values from java class in javascript in jquery is working. While setting a width and height in firefox, which show scroll bar always eventhough content is not there. I tried with css options overflow: auto but of no use. Also it works well in IE 9+.

$("#idofDiv").resizable();
        $("#idofDiv").resizable({
            start: function(e,ui){
            },
            resize: function(e,ui){
            },
            stop: function(e,ui){
            var newWidth = $("#idofDiv").width();
                var newHeight = $("#idofDiv").height();
                JavaClass.setWWidth(newWidth.toString());
                JavaClass.setWHeight(newHeight.toString());
                $("#idofDiv").width(parseInt(newWidth));
                $("#idofDiv").height(parseInt(newHeight));
            }
        });

In the above code while resizing the div tag i am storing values in session using DWR. It is working fine. In div element if the content exceeds then scroll bar should be displayed.But in mozilla scroll bar is displayed everytime but in IE it is working fine. I have used overflow: auto for the content overflow. Any help will be appreciated.

Shriram
  • 4,343
  • 8
  • 37
  • 64

1 Answers1

0

It may be because the TD element's 'display' property is inherently set to 'table-cell' rather than 'block'. You may want to try adding following css rules:

#table{
    table-layout:fixed;
    overflow:hidden; 
    white-space: nowrap; 
}

Please check more in this post.

Community
  • 1
  • 1
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133