td高度500,div在td内的最底部。

黑心 2011-09-23 11:53:41
如下:div在td的最底部。

<table><tr><td height='500' valign='top'>
这里有些文字。
<div>我要在最底部。 </div>
</td></tr></table>
...全文
248 14 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
黑心 2011-09-23
  • 打赏
  • 举报
回复
是。
“这里有些文字。这里可能有表格table.” 在top


001007009 2011-09-23
  • 打赏
  • 举报
回复
楼主的意思 让
“这里有些文字。” 在top
<div>我要在最底部。 </div> 在 bottom?
黑心 2011-09-23
  • 打赏
  • 举报
回复
谢谢各位回答,特别是5L的提醒。谢谢了。
黑心 2011-09-23
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 flying_wind2008 的回复:]
那用绝对定位吧
<style>
table{
border-collapse:collapse;
margin-left:10px;
width:300px;
}
td{
display:inline-block;
position:relative;
}
div{
position:absolute;
bottom:0;
left:0;
}
</style>
……
[/Quote]

嗯,不错。
看我的。多套了层表:
<table width='100%' height='100%' border='0' cellspacing='1' cellpadding='0' align='center' bgcolor='#ff0000'><tr><td bgcolor='#f1f1f1' valign='top'>
<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td valign='top'>
这里有些文字。这里有些文字。这里有些文字。这里有些文字。这里有些文字。这里有些文字。这里有些文字。 </td></tr>
<tr><td style='color:#aaaaaa;height:20px;' height="20">我要在最底部</td></tr>
</table></td></tr></table>
001007009 2011-09-23
  • 打赏
  • 举报
回复
指定 上面td的height 也可以。div用margin或者position 都可以。。。
flying_wind2008 2011-09-23
  • 打赏
  • 举报
回复
那用绝对定位吧
<style>
table{
border-collapse:collapse;
margin-left:10px;
width:300px;
}
td{
display:inline-block;
position:relative;
}
div{
position:absolute;
bottom:0;
left:0;
}
</style>
<table border="1">
<tr><td height='500px' valign='top'>这里有些文字。这里有些文字。这里有些文字。这里有些文字。这里有些文字。这里有些文字。这里有些文字。<div>我要在最底部。</div></td></tr>
</table>
黑心 2011-09-23
  • 打赏
  • 举报
回复
<table height='500px' border="1" >
边框必须有。
黑心 2011-09-23
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 calmcrime 的回复:]
HTML code

<table><tr><td height='500'>
<table cellpadding="10"><tr><td height="400" valign="top">这里的内容在要顶部。</td></tr></table>
<div>我要在最底部。 </div>
</td></tr></table>




这样?
[/Quote]
嗯 ,也有点像,
<div>我要在最底部。 </div>
这个div要在最底部显示。
黑心 2011-09-23
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 flying_wind2008 的回复:]
<table height='500px' border="1" >
<tr><td height='100%' valign='top'>这里有些文字。</td></tr>
<tr><td height='20px' ><div>我要在最底部。</div></td></tr>
</table>
[/Quote]

有点像。但这样会多少条边框。本来只需要一个框的。现在这样是两个框。
001007009 2011-09-23
  • 打赏
  • 举报
回复

<table><tr><td height='500'>
<table cellpadding="10"><tr><td height="400" valign="top">这里的内容在要顶部。</td></tr></table>
<div>我要在最底部。 </div>
</td></tr></table>



这样?
flying_wind2008 2011-09-23
  • 打赏
  • 举报
回复
<table height='500px' border="1" >
<tr><td height='100%' valign='top'>这里有些文字。</td></tr>
<tr><td height='20px' ><div>我要在最底部。</div></td></tr>
</table>
黑心 2011-09-23
  • 打赏
  • 举报
回复
NO

<table><tr><td height='500' valign='top'>
<table cellpadding="10"><tr><td>这里的内容在要顶部。</td></tr></table>
<div>我要在最底部。 </div>
</td></tr></table>
001007009 2011-09-23
  • 打赏
  • 举报
回复

<table><tr><td height='500' valign='bottom'>
<table cellpadding="10"><tr><td>123</td></tr></table>
<div>我要在最底部。 </div>
</td></tr></table>


这个意思?
查询了一下相关的资料,Div没有自动滚动的属性,只能模拟鼠标的滚动来现实想要的效果。 关键的部分部分在这里:div.scrollTop = div.scrollHeight; 下面是具体实现的精简代码: 代码如下: <html> <body> <div id=”divDetail” xss=removed> <td>idtd><td>nametd><td>agetd><td>memotd><td>

61,129

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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