Coder Social home page Coder Social logo

Tables about attractions HOT 3 CLOSED

illright avatar illright commented on August 11, 2024
Tables

from attractions.

Comments (3)

illright avatar illright commented on August 11, 2024

Well, the Pagination component exposes a currentPage prop which you can read and use to alter the data in the table:

<script>
  import { Pagination } from 'attractions';
  import { Table } from 'elsewhere';

  let currentPage = 1;
  const totalPages = 20;
  const itemsPerPage = 10;

  export let tableData;
</script>

<Table data={tableData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage)} />
<Pagination bind:currentPage pages={totalPages} />

We don't provide a Table component yet, though it could be added in the future. We are a little busy with other work at the moment to add it in right now, but we would certainly welcome a PR adding it.

from attractions.

aabounegm avatar aabounegm commented on August 11, 2024

If you liked the tables in the documentation, you can take a look at the docs/static/css/mdsvex folder, where we keep the SCSS for table, th, tr, and td. I am thinking it shouldn't be too much work copying them over to a new component while adding a few SCSS variables and slots here and there, but I am not sure when I will be able to give it a shot. If you come up with something and would like to add it to the library, we would be happy to merge it.

from attractions.

orefalo avatar orefalo commented on August 11, 2024

Thank you so much. It's enough for my current use case

from attractions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.