Skip to content

Instantly share code, notes, and snippets.

@SirmaXX
Last active February 9, 2021 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SirmaXX/483224ccc6132ff51c8384fb5da2fcca to your computer and use it in GitHub Desktop.
Save SirmaXX/483224ccc6132ff51c8384fb5da2fcca to your computer and use it in GitHub Desktop.
multiplication and counting table with react.js
import React from "react";
function NumberTable() {
const row = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const col = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11];
return (
<div>
{col.map((ncol) => (
<tr>{
row .map(mrow => (<td>{mrow * ncol}</td>
))}
</tr>
))}
</div>
);
}
export default NumberTable;
import React from "react";
function NumberTable() {
const row = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const col = [0, 1, 2,3, 4, 5, 6, 7, 8, 9];
return (
<div>
{col.map((ncol) => (
<tr>{
row .map(mrow => (<td>&nbsp;{(mrow + (ncol*10))}&nbsp; </td>
))}
</tr>
))}
</div>
);
}
export default NumberTable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment