/js_growth_table_DOM

JS Advanced task. Add new columns and rows to the table.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

  1. Replace <your_account> with your Github username in the link
  2. Follow this instructions
    • Run npm run test command to test your code;
    • Run npm run test:only -- -n to run fast test ignoring linter;
    • Run npm run test:only -- -l to run fast test with additional info in console ignoring linter.

Task: Growth table

Let's blow up this table!

Your task sounds simple: Do you see yellow buttons? Give the table the opportunity to grow in different directions.

Preview: Preview

Some rules:

  • Click on the button with class append-row should append a new row to the table.
  • Click on the button with class remove-row should remove the last row from the table.
  • Click on the button with class append-column should append a new column to the table.
  • Click on the button with class remove-column should remove the last column from the table.
  • The max count of rows or columns is 10.
  • The min count of rows or columns is 2.
  • If the count of columns or rows reaches maximum or minimum, set disabled the corresponding button.
  • If the count of columns or rows can be changed again (after reaching maximum or minimum), set enabled the corresponding button.

As always, on JS Advanced course you do not need to change the HTML layout or CSS styles.

Examples: image

2x2

3x10