前端分页的时候怎么确定每页条数比较好?

遗落之章 2021-03-25 05:44:52
1、固定每页多少条,如20、40,可在数值间选择
2、根据可见区高度计算显示每页条数
...全文
1258 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Stephen_112 2021-04-08
  • 打赏
  • 举报
回复
超过了高度出滚动条不很好吗,为什么要抗拒滚动条?
遗落之章 2021-04-08
  • 打赏
  • 举报
回复
按照可用高度计算条数的话会有最多一条的高度的空白,固定每页条数的话可能会有很多空白,可能出滚动条,感觉体验上按高度计算会更舒服,但看了很多网站没几个按照高度计算条数的,就有些奇怪
大然然 2021-04-01
  • 打赏
  • 举报
回复
好点发分页是可以让用户自己选的,下拉框定几个值 10,15,20 .。。。。。
小鬼bustern 2021-03-29
  • 打赏
  • 举报
回复
合理一些的话,最好的当前显示条数的1.5倍
sha虫剂 2021-03-29
  • 打赏
  • 举报
回复
按习惯是管理系统之类的15每页,移动端列表类10条,嵌套类4-6条(看实际情况)。这个东西没有什么固定多少的
sha虫剂 2021-03-29
  • 打赏
  • 举报
回复
这个东西看你的设计大小,一般是刚好一屏的数量就好,或者是产品给出每页多少条
遗落之章 2021-03-26
  • 打赏
  • 举报
回复
引用 2 楼 一品梅 的回复:
前端:
<table class="table table-striped">
    <thead>
        <tr>
            <th>LCID</th>
            <th>English Name</th>
            <th>Native Name</th>
            <th>Culture types</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var c in Model.CulturesList)
        {
            <tr>
                <td>@c.LCID</td>
                <td>@c.EnglishName</td>
                <td>@c.NativeName</td>
                <td>@c.CultureTypes</td>
            </tr>
        }
    </tbody>
</table>
老兄你说的是怎么实现分页,不是我问的东西啊
一品梅 2021-03-25
  • 打赏
  • 举报
回复
前端:
<table class="table table-striped">
    <thead>
        <tr>
            <th>LCID</th>
            <th>English Name</th>
            <th>Native Name</th>
            <th>Culture types</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var c in Model.CulturesList)
        {
            <tr>
                <td>@c.LCID</td>
                <td>@c.EnglishName</td>
                <td>@c.NativeName</td>
                <td>@c.CultureTypes</td>
            </tr>
        }
    </tbody>
</table>
一品梅 2021-03-25
  • 打赏
  • 举报
回复
后台:
CulturesList = Cultures
            //make sure to order items before paging
            .OrderBy(x=>x.EnglishName)
 
            //skip items before current page
            .Skip((P-1)*S)
 
            //take only 10 (page size) items
            .Take(S)
            
            //call ToList() at the end to execute the query and return the result set
            .ToList();

61,112

社区成员

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

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