急,如何获取
的高度

cherry_j 2007-03-13 04:23:14
<div id='scrollDiv' style='DISPLAY: inline; OVERFLOW: auto; WIDTH: 100%; CURSOR: default; HEIGHT: 800px'>

我想实现一个固定表头的table,用div嵌套
在HEIGHT: 800px情况下可行,但用户不想固定高度

我尝试用HEIGHT: 100%就功能不行了

请问如何根据实际高度给div设置高度呢?
...全文
490 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hanguoji84 2007-03-13
  • 打赏
  • 举报
回复
呵呵都是高手,转成服务器控件后台设应该可行吧。
cherry_j 2007-03-13
  • 打赏
  • 举报
回复
看看这个对你可能会有点用
http://blog.csdn.net/cpp2017/archive/2007/02/03/1501636.aspx

---------------------------------------------------------------------
这个我看过了
但我是html table填充的数据滚动,好像有点区别- -#
深度Java 2007-03-13
  • 打赏
  • 举报
回复
你说的其实是 “Div高度自适”!高度100%的绝对定位自适应布局
文章来源于 《高度100%的绝对定位自适应布局》
http://www.blueidea.com/bbs/NewsDetail.asp?lp=1&id=2494868

http://www.rexsong.com/blog/article.asp?id=165
或者
http://www.blueidea.com/tech/web/2006/3131.asp

方法1
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
</head>

<body style="height:100%; margin:0;">

<div style="width:100%; margin:0 auto; text-align:center; background:#FF9400; height:100px; position:absolute; top:0; line-height:100px;">head</div>

<div style="width:100%; margin:0 auto; background:#eee; height:100%;">
<div style="height:101px; background:#fff;"></div>

<div style="height:101px; background:#eee;"></div>
</div>

<div style="width:100%; margin:0 auto; text-align:center; background:#f00; height:100px; position:absolute; bottom:0; line-height:100px;">foot</div>

</body>
</html>


方法2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
body,html{
height: 100%;
padding: 0;
margin: 0;
}
#header,#footer{
height: 10%;
background: #EBF7F9;
}

#container{
min-height: 80%;
background: #FDF5E6;
}
/*\*/
* html #container{
height: 80%;
}
/**/
</style>
</head>

<body>
<div id="header">...</div>
<div id="container">
<div id="mainbg">
<div id="left">...</div>
<div id="right">...Cellular Technologies
Cell line development
Engineered cell-based assays
Cell based assays are an essential tool in understanding biological pathways especially when linked to high throughput readouts. Native cell lines or cells engineered to express foreign reporter genes can be used to read out a biological target or pathway or to confirm the activity and mechanism of action of drug candidates. Dragonfly has extensive experience in establishing known cell-based assays or developing new ones.

Examples of engineered cells and assays which Dragonfly has experience in include:

Heterologous or chimeric receptor growth factor assays. Growth factor dependent cells can convenient cellular bioassays for growth factors or cytokines. Dragonfly has engineered heterologous human or rodent receptors into factor dependent cells as stable transformants to provide a readouts for ligand induced receptor activation or to assay small molecule or antibody antagonists. We have also engineered chimeric receptors with novel extracellular domains linked to a signaling intracellular domain to derive ligand dependent cell lines.
Engineered reporter cell assays. Reporter genes may be used to monitor promoter activity, the expression of tagged proteins, or to read out a biological pathway. Dragonfly has experience with multiple cell types engineered to express a variety of epitope tagged proteins or reporter proteins adapted to high throughput, 96 well assays. Examples of epitope tags or reporters we have worked with include: FLAG, His6, myc, GFP and lac Z.
</div>
</div>
</div>
<div id="footer">...</div>

</body>
</html>

cpp2017 2007-03-13
  • 打赏
  • 举报
回复
看看这个对你可能会有点用 http://blog.csdn.net/cpp2017/archive/2007/02/03/1501636.aspx
cpp2017 2007-03-13
  • 打赏
  • 举报
回复
要用脚本设. 如scrollDiv.style.height = document.getElementById("table2").offsetHeight;

62,073

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧