Giter Site home page Giter Site logo

krajnova / js_task_generate_table_dom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mate-academy/js_task_generate_table_dom

0.0 0.0 0.0 462 KB

JS Advanced task. Generate table from data.

License: GNU General Public License v3.0

JavaScript 20.92% HTML 28.23% CSS 50.85%

js_task_generate_table_dom's Introduction

  1. Replace <your_account> with your Github username in the link
  2. Follow this instructions
    • There are no tests for this task so use npm run lint command instead of npm test

Task: Generate dashboard from JSON

This task requires knowledge of how HTML table works. You can learn it here:

Okay, now we know what is a table, and can do some magic. In main.js, you already have imported file people.json. Variable people contains an array of people, you can check it by console.log. Your task today is to convert this array to table rows.

Your layout for start:

Preview

From the preview, you can see that table has 6 headers, but our data does not contain age and century. Yes, you need to get them by yourself.

Steps to do this challenge:
  1. For each person from people array create table row with 6 table cells (name, gender, born, died, age, century)
  2. Find a table with class dashboard in the document.
  3. Append created row to table.
  4. Done.

Hints:

  • Age is person.died - person.born
  • Century:divide year of person's death by 100 Math.ceil(person.died / 100)

You no need to change styles or HTML layout in this task. Change only main.js file.

Expected result:

Preview

js_task_generate_table_dom's People

Contributors

vpolets avatar

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.