diff --git a/06_Day_Map_List_Keys/06-my-map-list-keysc/public/index.html b/06_Day_Map_List_Keys/06-my-map-list-keysc/public/index.html index 403bb80..9d3c06d 100644 --- a/06_Day_Map_List_Keys/06-my-map-list-keysc/public/index.html +++ b/06_Day_Map_List_Keys/06-my-map-list-keysc/public/index.html @@ -127,8 +127,14 @@ text-align: center; } + table { + width: 50%; + align-content: center; + margin-left: 15%; + } + tr { - height: 25px; + height: 25px; } .td-name { @@ -143,7 +149,8 @@ .td-value { width: 80px; - text-align: right; + text-align: left; + padding-left: 5%; } .div-line { @@ -151,25 +158,6 @@ background-color: orange; } - .graph-title { - font-size: small; - font-family: Arial; - text-align: center; - } - - .graphs { - display: flex; - justify-content: center; - } - - #stat { - display: flex; - justify-content: center; - } - - .stat-table { - border: thin solid gray; - } diff --git a/06_Day_Map_List_Keys/06-my-map-list-keysc/src/index.js b/06_Day_Map_List_Keys/06-my-map-list-keysc/src/index.js index 7cb35d8..e1390aa 100644 --- a/06_Day_Map_List_Keys/06-my-map-list-keysc/src/index.js +++ b/06_Day_Map_List_Keys/06-my-map-list-keysc/src/index.js @@ -58,17 +58,21 @@ const Main = ({ numbers }) => ( ) //Population +function numberWithCommas(x) { + return x.toString().replace(/\B(? { const countryList = countries.map((country) => {country.name} -
+
{country.name}
- {new Intl.NumberFormat('ru-RU').format(country.population)} + {numberWithCommas(country.population)} ) @@ -79,7 +83,7 @@ const Country = ({ countries }) => { const Population = ({ countries, count }) => (

{count} most populated countries in the world

- +
) @@ -101,7 +105,7 @@ const App = () => { .map((country) => { return { name: country.name, population: country.population } }) - + const world = data .map((country) => { return { name: country.name, population: country.population } @@ -110,7 +114,7 @@ const App = () => { return { name: 'World', population: w.population += c.population, languages: [] } }, { name: 'World', population: 0 }) data.push(world) - + // find top countries by population and add field Prc - country population / world population const topCountries = data .map((country) => { @@ -121,7 +125,7 @@ const App = () => { )) .slice(0, count + 1) .map(({ name, population }) => ({ name: name, population: population, prc: (population / world.population) * 100 })) - + return topCountries })