white-space: nowrap not working in ie

For non-ie browsers like mozilla the below code will work:

<table>

<tr>

<td style=”white-space: nowrap”>text here</td>

</tr>

</table>

but the above will not work for ie browser, so this is what will work for ie :

<table>

<tr>

<td><span  style=”white-space: nowrap”>text here</span></td>

</tr>

</table>

max-width, max-height for IE6

Basically max-width, min-width, max-height and min-height are the properties of CSS 2 and are not supported by IE 6. It works well with IE 7 and mozilla firefox but not with IE 6 and lower versions of IE.

But i have found a solution for this and it goes as below:

eg: if you have one or more image to display such that there should be some restrictions of height and width of image. i.e. image should not be having width more than 500 (suppose) and height not more than 200, then the css for the image should be as given below:

img.thumb_100{

max-height:100px;

max-width:100px;

width:expression(document.body.clientWidth > 500? “500px”: “auto” );

height:expression(document.body.clientHeight > 200? “200px”: “auto” );

}

same way you can try for min-width and min-height.

Thanks,

Sachin (http://www.avidindiainc.com)

Browser detection html code

Need some method for browser detection with HTML itself, here it is.

With this method you can detect whether your browser is IE or non-ie (i.e. mozilla firefox, safari, opera etc.)

Now you won’t have to write server side script such as php, .net and others or client side script such as javascript or vb script for browser detection and accordingly output your HTML code.

The method is simple as shown below:

For displaying HTML code only in IE:

<!--[if IE]> Here comes the HTML Code <![endif]-->

For displaying HTML code in browsers other than IE:

<!--[if !IE]>--> Here comes the HTML Code <!--<![endif]-->

Also you can have your code work with different versions of IE.
i.e.
<!--[if lt IE 7]> Here comes the HTML Code <![endif]-->

here the HTML code will work only for IE having version less than IE 7. and here lt means less than

also you can even write lte which means less than equal to

Hope this method help you out with your problems.

Sachin (samsami2u@gmail.com)