如何在我的桌子高度调整100%,在所有的屏幕分辨率 [英] How to adjust 100% on my table height in all Screen resolution

查看:100
本文介绍了如何在我的桌子高度调整100%,在所有的屏幕分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,边框宽度为1。

I have a table and the border width is 1.

我如何可以调整所有的屏幕分辨率的高度为100%?
或使用jQuery我怎么能动态改变高度的桌子?

How can I adjust the height to 100 % in all screen resolutions? Or using jQuery how can I dynamically change the table heights?

我在Web应用程序中新的

I am new in web application

请帮忙吗?...

拉​​杰什

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0    Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
</head>

<script src="./Scripts/jquery-1.4.1.js" type="text/javascript">
jQuery(document).ready(function () {
    jQuery('#SprImg').attr("height", jQuery(window).height());
}); 
</script>

<body>

<table id="Table1" cellpadding="0" cellspacing="0" runat ="server" width="100%" border="0" align="left">
    <tr>
            <td id="LeftPane"    align="left" valign="top" width="175" runat="server"  ></td>
            <td id="RightPane"  align="left" width="*.*" runat="server" valign="top">
             <img id="SprImg" src="./Image/login.gif"  alt="" /> 

            </td>
    </tr>
</table>


推荐答案

您可以使用一个技巧,使这一点。将 IMG 在某处你的这需要一整列上下,这是不可见的。然后为onload您更改此图像高度的文档的高度,你强制表借此高度。

You can use a trick to make that. Place an img somewhere in your table that takes a full column from top to bottom, that is non-visible. Then onload you change this image height to the document height, and you force the table to take this height.

jQuery(document).ready(function() {
    jQuery('#SprImg').attr("height", jQuery(window).height());
});

和形象,也就是 1x1像素透明GIF

 <img id="SprImg" src="/images/spacer.gif" width="1" height="1" alt="" />

将它放在一个列,它是由升转跌进去。现在,您可以绑定窗口改变大小,对图像高度不断改变的情况下,窗口高度,用户调整浏览器。

Place it somewhere inside a column that is from up to down. Now you can bind the window change size, to constantly change the image height to the window height in case that the user resize the browser.

整个页面。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

    <script>
    jQuery(document).ready(function () {
        jQuery('#SprImg').attr("height", jQuery(window).height());
    }); 
    </script>

</head>
<body>

<table id="Table1" cellpadding="0" cellspacing="0" runat ="server" width="100%" border="1" align="left">
    <tr>            
        <td id="LeftPane"    align="left" valign="top" width="175" runat="server">
            test text
        </td>
        <td id="RightPane"  align="left" width="*.*" runat="server" valign="top">
            <img id="SprImg" src="/img/ui/spacer.gif" width="1" height="1"  alt="" /> 
        </td>
    </tr>
</table>

</body>
</html>

这篇关于如何在我的桌子高度调整100%,在所有的屏幕分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆