How to Create Tabular Data with Link See More?

0

I'm pulling from the records database of a given table.

I want to show only 4 on 4 records on the screen. But I would like to pull all at once rather than paging (1, 2, 3, 4).

I want to show 4 lines and put down a SEE MORE button and when the user clicked I would show 4 more lines and so on until I finish.

How can I start doing this?

I do not have anything ready. Just the table, but differentiated.

I did not make the table with table and yes with ul .

    
asked by anonymous 04.03.2016 / 14:32

1 answer

2

Resolved.

I made a CSS and a little jQuery .

CSS

ul {
   li {
      &:nth-child(n+5){
      display: none;
   }
}

In the above code I show only 4 lines.

HTML

<div class="btn-ver-mais">
   <span>Ver mais</span>
</div>

Over the View more button.

jQuery

// Limitação de Lista de Concessionárias de 4 em 4 linhas
$('.btn-ver-mais').click(function() {
    $('.content-resultados li:hidden').slice(0, 4).show();
    if ($('.content-resultados li').length == $('.content-resultados li:visible').length) {
        $(this).addClass('disabled');
    }
});

And in the code above when I click the See More button, I select all rows that are hidden or hidden , from position 0 and show up to 4 rows, with the function slide() ;

And if the number of lines visible is equal to the total number of rows I disable the See more button.

Thanks to those who voted to close because they were not clear enough.

    
04.03.2016 / 15:10