views:

54

answers:

5

Int the following code, The scroll bar appears in IE and in mozilla it doesnt,how is this to be fixed,scroll bar should not appear where there is not much of data.

<script>
var row= '<table><tr>';
row = '<tr class="display_row"">';
row += '<td  class="display_col" wrap width="75"><b><textarea rows = "8" cols = "18" border ="1" class="input" style="border: none;overflow:visible;width:95%;" readonly maxlength="5">Name selected is Tom </textarea>';
 row+='</td></tr></table>';
 </script>
+1  A: 

This looks like you are not using the textarea for editing, but to display data. My suggestion would be not to use a textarea then you'll be more flexible with the styling.

Also: What is the table good for?

RoToRa
+1  A: 

This is normal behaviour in IE: Areas that could become scrollable when their content exceeds the container's height, but aren't get a deactivated scroll bar.

To my knowledge, this can not be turned off except in some elements (I've never analyzed which ones exactly) by using overflow: hidden - but then, the scroll bar is gone forever.

Pekka
A: 

Use overflow: hidden in the style for the text area.

Dominic Cooney
That will remove the scroll bar altogether.
Pekka
A: 

scroll bar should not appear where there is not much of data

So use overflow:auto and let the browser do the work.

nc3b
A: 

overflow:auto is the right answer.

Holy unsemantic coding in your example, though.

hollsk
I don't think `overflow: auto` will work here - IE will display a disabled scroll bar no matter what.
Pekka
Nope. The auto value tells IE to hide the scrollbar if it's not needed, and display it if it becomes needed. It's a reasonably well-documented issue.
hollsk