Jquery 有一个滚动表,想从滚动的底部开始吗?

Jquery 有一个滚动表,想从滚动的底部开始吗?,jquery,Jquery,我有一个动态填充的jqueryscorling表。我正在使用 我想要的是,当页面加载时,表应该位于底部,当动态添加新行时,这应该是焦点所在的位置 应用脚本后,它在表周围创建了div…这是源代码: <div style="overflow: hidden; display: inline-block; border: 0px solid rgb(136, 136, 136);" id="placeordetb_table_wrap"> <div style="width: 100

我有一个动态填充的jqueryscorling表。我正在使用

我想要的是,当页面加载时,表应该位于底部,当动态添加新行时,这应该是焦点所在的位置

应用脚本后,它在表周围创建了div…这是源代码:

<div style="overflow: hidden; display: inline-block; border: 0px solid rgb(136, 136, 136);" id="placeordetb_table_wrap">
<div style="width: 100%; overflow: hidden;" id="placeordetb_head_wrap">
<table style="table-layout: fixed;" class="placeorder_items" id="placeordetb_head" border="0" cellpadding="0" cellspacing="0" width="100%">
</table>
</div>
<div style="width: 100%; height: 160px; overflow: auto;" id="placeordetb_body_wrap">                     <table class="placeorder_items" id="placeordetb" border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody>
       <tr valign="top">    
        <th>Line number</th>
        <th>Notes</th>
        <th>Profile</th>
        <th>Inner</th>
        <th>Outer</th>
        <th>Length</th>
        <th>Unit</th>
        <th>Qty</th>
        <th>Line Value (Net)</th>
        <th></th>
       </tr>
       <tr id="10">
       <td>10</td>
       <td style="text-align: center;"></td>
       <td></td><td></td><td></td><td></td><td>6.5</td><td>1</td>
       <td></td>
       <td><a href="javascript:deleteRow(1029,10)">Delete</a></td></tr>
      </tbody>
</table>
</div></div>

行号
笔记
轮廓
内部的
外面的
长度
单位
数量
行值(净额)
10
6.51
正常:

<div  class="placeorder_item">

<table width="100%" cellpadding="0" cellspacing="0" border="0" class="placeorder_items" id = "placeordetb" >
<tr valign="top">   
<th>Line number</th>
<th>Notes</th>
<th>Profile</th>
<th>Inner</th>
<th>Outer</th>
<th>Length</th>
<th>Unit</th>
<th>Qty</th>
<th>Line Value (Net)</th>
<th></th>
</tr>

<tr id="10" >   
<td>10&nbsp;</td>
<td  style="text-align:center;">
    </td>
<td>etc010&nbsp;</td>
<td>1002M&nbsp;</td>
<td>1003&nbsp;</td>
<td>6.500 &nbsp;</td>
<td>L6.5&nbsp;</td>
<td>1&nbsp;</td>
<td>62.52&nbsp;</td>

行号
笔记
轮廓
内部的
外面的
长度
单位
数量
行值(净额)
10
etc010
1002M
1003
6.500
L6.5
1.
62.52
删除

使用jQuery的方法动态处理滚动:

$(document).ready(function(){
    var scrollBottom = Math.max($('#placeordetb').height() - $('#placeordetb_body_wrap').height(), 0);
    $('#placeordetb_body_wrap').scrollTop(scrollBottom);
});

请参见以下示例。

演示是否至少适合您?不幸的是,我只能让它和你们提供的HTML一起工作,并且不知道为什么它不能在页面中工作。您的工作副本是否有一个公共URL,可以附加到您的问题中?在我应用创建滚动后,必须向下移动代码…谢谢