How to scrape part of a page node.js

I’m fairly new to coding and I don’t understand why my code isn’t working. It is suppose to output "Dominus Empyreus"
Though it only outputs []

Here is my current code:

const axios = require('axios'); 
const cheerio = require('cheerio'); 
 
const extractLinks = $ => [ 
    ...new Set( 
        $('.border-bottom item-name-container') // Select pagination links 
            .toArray() // Convert cheerio object to array 
    ), 
]; 
 
axios.get('https://www.roblox.com/catalog/21070012/Dominus-Empyreus').then(({ data }) => { 
    const $ = cheerio.load(data); // Initialize cheerio 
    const stuff = extractLinks($); 
 
    console.log(stuff); 
    // ['Dominus Empyreus'] 
});

Any help is appreciated! Thanks.

Datatables.net MVC JavaScript Populated table erroneously shows Showing 0 to 0 of 0 entries

First time using DataTables.net with MVC and JavaScript. On my .cshtml page I have a Datatables.net table that correctly brings back data and populates the table using JavaScript. (I have copied this from another example that also brings back data correctly and populates the table.) My problem is that at the bottom of the table it erroneously shows Showing 0 to 0 of 0 entries despite displaying multiple rows of information. (on the example that I copied from it correctly shows 1 of 20 entries).

My code below:

<script type="text/javascript">
    
function getTransactionListingHistory(contactCode) {
    var groupColumn = 1;

    if ($.fn.dataTable.isDataTable('#datatableTransactions')) {
        table = $('#datatableTransactions').DataTable();
        table.destroy();
    }

    var historyTable = $('#datatableTransactions').DataTable({
        order: [0, "desc"],
        "processing": true,
        "serverSide": true,
        "filter": false,
        "ajax": {
            "url": "/Transactions/TransactionsGetData?contactCode=" + contactCode,
            "type": "POST",
            "datatype": "json"
        },
        columnDefs: [
            //{ "targets": [1], "visible": false, "searchable": false }
        ],
        "columns": [
            {
               "data": "lineDate", "name": "LineDate", "autoWidth": true,
                 
            },               
            {
                "data": "lineReference", "name": "lineReference", "autoWidth": true,
                "render": function(data, type, row) {               

                    return data;
                }
            },
            {
                "data": "formattedDebitAmount", "autoWidth": true, "defaultContent": "",
                "render": function(data, type, row) {
                    if (data != null) {
                        return "<a class='text-danger text-right text-nowrap'>" + data + "</a>";
                    }
                }
            },    
            {
                "data": "LineID",                 "name": "lineID",                 "autoWidth": true, 
                "render": function(data, type, row)  
                {
                    
                        return '<a onclick="repeatTransaction(' + ''' +  row.lineID + '');"  href="#" id="repeat-link"><img src="' + "/images/icons/refresh.svg" + '" />&nbsp;' +  'Repeat' + '</a>';
                        
                }
            }, 
        ],
        fixedHeader: true,
        "aLengthMenu": [[10, 25, 50, 100, 250, 500], [10, 25, 50, 100, 250, 500]],
        "iDisplayLength": @myPagingSize,
        language: {
            processing: "<div style='color: #ff6611!important;' class='spinner-border text-warning m-2' role='status' aria-hidden='true'></div>&emsp;Processing ...",
            paginate: {
                next: '<i class="fas fa-arrow-right"></i>',
                previous: '<i class="fas fa-arrow-left"></i>'
            }
        }
    });

    $('#datatableTransactions_paginate ul.pagination').addClass("pagination-rounded");

    
};    
</script>

I have an element centered in the screen and I want another element to be centered just right below the first element [duplicate]

So, here’s index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>
    <title>Document</title>
</head>
<body>
    <div class="circle">
    <div class="small-circle"></div>
    </div>
    <strong><span class="time-units">
        <span class="hours">00</span>:
        <span class="minutes">00</span>:
        <span class="seconds">00</span>:
        <span class="nanoseconds">00</span>
    </span></strong>

    <div class="ui-buttons">
        <span>
            <button class="btn-start">Start</button>
            <button class="btn-pause">Pause</button>
            <button class="btn-stop">Stop</button>
        </span>
    </div>
</body>
</html>

And here’s style.css

@import url('https://fonts.googleapis.com/css2?family=Anek+Latin:wght@600&family=Kanit:wght@300&family=Open+Sans&family=PT+Sans&family=Poppins:wght@300;500&family=Roboto+Mono:wght@700&family=Smooch+Sans:wght@300;900&family=Source+Sans+Pro&display=swap');

body {overflow: hidden; font-family: 'Poppins', sans-serif;}

body {
    background-color: #FFE53B;
    background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
}

html, body { height: 100%; }

.circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-image: linear-gradient(#cc2b5e, #753a88);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 50px;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
}

.time-units {
    padding: 20px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Poppins', sans-serif;
}

.small-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    background-color: gold;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
}

.btn-start {
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
    padding: 5px;
}

button {
    width: 220px;
    height: 50px;
    border: none;
    outline: none;
    color: #fff;
    background-color: gold;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
}

I have a circle div with class of circle (Ignore the other class) and it’s centered. Now I have 4 buttons with classes of ui buttons. I want them to be centered but just below the circular div and not overlap it which happens if I use position: absolute;, top,left set to 50% and transform: translate(-50%, -50%);

при отправке запроса получаю ошибку has been blocked by CORS policy и net::ERR_FAILED 200 [closed]

Есть запрос для автозаполения формы jQuery, но при нем выбивает ошибку “has been blocked by CORS policy”, искал решения, но работающего решения пока никак не смог найти…:
$(“#pick-up_from”).autocomplete({
source : function(request, response) {

    $.ajax({

        url : 'https://www.transfermilan.com/ajax.html',

        data : "json",

        method : 'post',

        data : {

            term : request.term,

            action : 'search_form_tarif',

            row_num : 1

        },

        success : function(data) {

            

response($.map(data, function(item) {

                var code = item.split("|");

                

                //alert(code);

                

                return {

                    label : code[0],

                    value : code[0],

                    data : item

                }

            }));

        }

    });

},

minLength: 2,//search after two characters

        

select : function(event, ui) {

    var names = ui.item.data.split("|");

    $('#direction_from').val(names[1]);

    //

    $('.loading_from').hide();

},

search : function(event, ui) {

    $('.loading_from').show();

},

focus : function(event, ui) {

    $('.loading_from').hide();

},

});

$(“#pick-up_to”).autocomplete({

source : function(request, response) {

    $.ajax({

        url : 'https://www.transfermilan.com/ajax.html',

        dataType : "json",

        method : 'post',

        data : {

            term : request.term,

            action : 'search_form_tarif',

            row_num : 1

        },

        success : function(data) {

            response($.map(data, function(item) {

                var code = item.split("|");

                return {

                    label : code[0],

                    value : code[0],

                    data : item

                }

            }));

        }

    });

},

minLength: 2,//search after two characters

        

select : function(event, ui) {

    var names = ui.item.data.split("|");

    $('#direction_to').val(names[1]);

},

search : function(event, ui) {

    $('.loading_to').show();

},

focus : function(event, ui) {

    $('.loading_to').hide();

},

});

// zagrygaem spiski gorodov

$(“#country_from, #country_to”).change(function () {

var id = $(this).attr("id");



if(id == 'country_from'){

    var dest =     'direction_from';

}

else {

     var dest =     'direction_to';

}

 

$("#" + dest).hide();

$("#loading_" + dest).show(); // запускаем 



var ajax_url = 'https://www.transfermilan.com/ajax.html'; 

$.post(ajax_url, { action: 'direction_from', id: $(this).val() }, updateFild);

    

function updateFild(data) {

    $('#' + dest).html(data);

    $("#" + dest).show();

    $("#loading_" + dest).hide(); // скрываем загрузку

    $('#orderForm').validate().element($('#' + dest)); //проверяем на валидность

    $('#orderForm').validate().element(this); //проверяем на валидность

}

});

// pokazivaem dopolnitelnie polja dlja viezda zagranizy

$(“#direction_from, #direction_to”).change(function () {

var type = $(this).attr("id");

      

var ajax_url = 'https://www.transfermilan.com/ajax.html'; 

        

$.post(ajax_url, { action: 'direction_type', id: $(this).val() }, showTypeFild);

 

$('#orderForm').validate().element(this); 

 

function showTypeFild(data) {

    

    //from

    if(type == 'direction_from'){

        if(data == 2){

            $('#city_from_filds').hide();

            $('#airport_from_filds').show();

        }

        else {

            $('#city_from_filds').show();

            $('#airport_from_filds').hide();

        }

    }

    //to

    else {

        if(data == 2){

            $('#city_to_filds').hide();

        }

        else {

            $('#city_to_filds').show();

        }

    }

 }//function

});

Unable to run typescript command after global installation on windows

So I installed typescript globally for the first time in my E drive by creating new folder through CMD with npm i -g typescript command. And I got tsc(file), tscserver(file) & typescript(folder) in my C:UsersSHUBHAM.npm-global directory. So only under this directory tsc -v this command works and not in any folder of E or D drive.
So at this point I’m not understanding although being installing typescript globally I’m getting error of

'tsc' is not recognized as an internal or external command, operable program or batch file.

I did try available solution for above error but no success. Any solutions over this problem are highly appreciated. Thank you!

How to check if some object values contains some string in array of strings in JavaScript

I’m working on a simple translate option, but I’m stuck in case when I have duplicated titles. When titles are different it’s working fine, but when I have duplicates it doesn’t translate them.

Here is the function:

function Translate(language, availableLanguages) {
    let titles = [...document.getElementsByClassName('translate')]
    let titlesValues = []

    titles.forEach((title) => {
        titlesValues.push(title.textContent)
    })

    for (let i = 0; i < availableLanguages.length; i++) {
        const languageObject = availableLanguages[i];
        
        titlesValues.forEach((title) => {
            if(Object.values(languageObject).includes(title)) {
                titles[titlesValues.indexOf(title)].textContent = languageObject[language]
            }
        })
    }
}

Here is the incoming languages json:

{
    "Languages": [
        "English",
        "German"
    ]
}

Here is the availableLanguages json:

[
    {
        "Key": "Hello",
        "English": "Hello",
        "German": "Hallo"
    }
]

Getting [Function: (function name)] instead of expected output

I’m currently learning some Javascript through Codecademy and I ran into this problem. When I run my program I get [Function: getComputerChoice] output to the console instead of what I’m expecting.

Here’s my code:

function getComputerChoice() {
  Math.floor(Math.random() * 3);
    switch (getComputerChoice) {
      case 0:
        return 'rock';
        break;
      case 1:
        return 'paper';
      case 2:
        return 'scissors'
    }
}

Thanks for taking the time to read my question.

How to loop through multiple elements based on class in Playwright JS test?

I am trying to write a Playwright JS test to scrape some values from a website.

Here is the HTML of the page I am trying to scrape:

<div class="pl-it">
   <div class="i_d">
      <dl>
         <dt class>Series:
         <dd>
            <a href=".....">Province A</a>
         </dd>
         </dt>
         <dt class>Catalog Codes:
         <dd>
            <strong>Mi</strong>
            <strong>CA 1x,</strong>
            "ca 17"
         </dd>
         </dt>
         <dt class>Variants:
         <dd><strong><a>Click to see variants</a></strong></dd>
         </dt>
      </dl>
   </div>
   <div class="i_d">
      <dl>
         <dt class>Series:
         <dd>
            <a href=".....">Province B</a>
         </dd>
         </dt>
         <dt class>Catalog Codes:
         <dd>
            <strong>Fu</strong>
            <strong>DE 2x,</strong>
            "pa 21"
         </dd>
         </dt>
         <dt class>Variants:
         <dd><strong><a>Click to see variants</a></strong></dd>
         </dt>
      </dl>
   </div>
</div>

As you can see, there are multiple divs that have class i_d, and inside those there are multiple dl tags.

Inside each dl tag, there is a pair of dt & dd tags.

Basically, what I am trying to do is log each dt value & each corresponding dd value to the console.

The final outcome should look something like this in the logs:

Series: Province A
Catalog Codes: Mi CA 1x, ca17
Variants: CLick to see variants

Series: Province B
Catalog Codes: Fu DE 2x, pa21
Variants: CLick to see variants

Below is my current output:

[
  {
    label: 'Series:',
    name: 'Province A'
  },
{
    label: 'Series:',
    name: 'Province B'
  },
]

As you can see, it is only printing out the first dt & dd values, not the remaining ones (i.e. Catalog Codes, etc.)

Here is my current Playwright JS code:

const { test, expect } = require('@playwright/test');

test('homepage has Playwright in title and get started link linking to the intro page', async ({ page }) => {
  await page.goto('https://colnect.com/en/stamps/list/country/38-Canada');

  await expect(page.locator('div#pageContent h1')).toContainText('Stamp catalog › Canada › Stamps')


  const books = await page.$$eval('div.i_d', all_items => {
    const data =[];
    all_items.forEach(book => {
      const label = book.querySelector('dt')?.innerText;
      const name = book.querySelector('dd')?.innerText;
      data.push({ label, name});
    })
    return data;
  });  
  console.log(books);
});

Can someone please tell me how I can access each dt & dd rather than just the first one in each group?

Nodejs Firestore: Returning nothing

I am using firebase to check a users punishment history, and when I call it:
I want it to return the array of embeds to post rather than just that. I am awaiting the function so I’m kind of confused why this is happening

  • This is what happens in the console.log “[AsyncFunction: CheckHistory]”

— CALL

let hist = await CheckHistory(id);
console.log(CheckHistory);

— FUNCTION

async function CheckHistory(user){
  CheckBan(user);
  let historyArray = [];

  const colRef = db.collection('punishments')
  colRef.where('user', '==', user).get().then(async querySnapshot => {
    length = querySnapshot.size;
    if (querySnapshot.empty){
      console.log(querySnapshot.size)
      return 0;
    } else {
      let docs = querySnapshot.docs;
      for (let documentSnapshot of docs) {
        const revoke = documentSnapshot.get('revoke')
  
        let active = documentSnapshot.get('active')
        if (active = true){
          active = "Active"
        } else {
          active = `Revoked for ${revoke}`
        }
        const mod = documentSnapshot.get('mod')
        const reason = documentSnapshot.get('reason');
        const time = documentSnapshot.get('time');
  
        let type = documentSnapshot.get('type');
        if (type == 1){
          type = "Blacklist";
        } else if (type == 2){
          type = "Dayban";
        } else if (type == 3){
          type = "Warning";
        }
  
        const username = await API.getUsernameFromId(user);
        const modname = await API.getUsernameFromId(mod);
  
        const historyEmbed = new MessageEmbed()
          .setColor('#0099ff')
          .setTitle(`'Punishment of ${username}:${user}`)
          .setDescription(`This is a punishment log.`)
          .addFields(
            { name: 'Status', value: `${active}`},
            { name: 'Moderator', value: `${modname}:${mod}` },
            { name: 'Reason', value: `${reason}` },
            { name: 'Type', value: `${type}` },
            { name: 'Time', value: `<t:${time}>`}
          )
            
        historyArray.push(historyEmbed);
  
        if (historyArray.length >= length) {
          return historyArray;
        }
      }
    }
  });
}```


  [1]: https://i.stack.imgur.com/AFrkB.png

Javascript wait for window to close before opening another

I need to open a series of popup windows, each window must be closed before the next one can be opened.

function openWindows() {
    var urls = getListOfUrls();
    
    for (let url of urls) {
        openWindow(url);
        // Wait for window to close before continuing.
    }
}

The only way I found to make sure that a window is closed is to use a setInterval which, as I understand it, causes the function behave asynchronously.

Any idea on how I can achieve this?

How to serve different paths in plain js server?

I am trying to create a simple server with js as below,

 {
var http = require('http');
var fs = require('fs');

const hostname = '127.0.0.1';
const port = 3000;

var routes = {
  '/test': (request, response) => {
    console.log('test...');
    response.end(JSON.stringify('Test 123'));
  },
  '/test1': (request, response) => {
    response.end(JSON.stringify('Test 1231'));
  },
  '/bk': function (request, response) {
    response.end(JSON.stringify('Test 1232'));
  },
};
const server = http.createServer(handleReq);

function handleReq(request, response) {
  console.log('test...');
  console.log(request.url);
  var route = routes[request.url];
  console.log(route);
  if (route) route(request, response);
  else {
    (response) => {
      response.writeHead(404);
      response.end(JSON.stringify('Not found'));
    };
  }
}

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

}

When i run the code in debug mode in VS Code, it serves all the routes as expected. But when i run it with command line “node serverTest.js”, it serves only the path “/test”. for others, it is just waiting on.

Any pointers to check more?

When I Block the Site , Still I am able to see the geolocation of the Browser using Reactjs

When I allow browser to get the Geolocation upon button Click, I am able to see the Latitude and Longitude. But when I block the site for accessing location, I am getting “Unable to retrieve your location” and Latitude and Longitude as well … Here When I Block the site, I should get only message “Unable to retrieve your location” and Latitude and Longitude should not show…Please find the Screenshot as wellenter image description here

Here is my Code

const GeolocationButton = () => {
    const [lat, setLat] = useState(null);
    const [lng, setLng] = useState(null);
    const [status, setStatus] = useState(null);
  
    const getLocation = () => {
      if (!navigator.geolocation) {
        setStatus('Geolocation is not supported by your browser');
      } else {
        setStatus('Please allow brower to access your Location');
        navigator.geolocation.getCurrentPosition((position) => {
          setStatus(null);
          setLat(position.coords.latitude);
          setLng(position.coords.longitude);
        }, () => {
          setStatus('Unable to retrieve your location');
        });
      }
    }
  
    return (
      <div className="App">
        <button onClick={getLocation}>Get Location</button>
        <h1>Coordinates</h1>
        <p>{status}</p> 
        {lat && <p>Latitude: {lat}</p>}
        {lng && <p>Longitude: {lng}</p>}
      </div>
    );
}

export default GeolocationButton

How to Run Google Maps on Mobile Device Using Local Server?

I am trying to find a workaround to get google maps working on my mobile device (iPhone) using my IPAddress:Port# for testing. I know I can use google chrome dev tools to simulate mobile device usage but I’ve found certain quirks that only appear when using an actual mobile device.

My site is written using Javascript/HTML/CSS and I’m using express/node.js as the backend.

Does anyone know of a way to get google maps to function using a mobile device in this scenario? Again, this is just for testing purposes, I know it will work when pointing to an actual https web address. It also works when using localhost:portnumber as the address.

Thanks for any advice or pointing me towards relevant documentation that I can read.

i need to add inputs to the form in index and then show it at statics page from local storage

i have those 3 erros and what im trying to achive is to output the from to the other page from local storage

statistics.js:64 Uncaught TypeError: Cannot read properties of null (reading ‘length’) at getData

Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
at
Uncaught TypeError: Cannot read properties of null (reading 'length')
at getData 

"use strict";
var allFood = [];
function food(foodName, foodType, price) {
  this.foodName = foodName;
  this.foodType = foodType;
  this.price = price;
  allFood.push(this);
}
food.prototype.fID = function () {
  this.id = Math.floor(1111 + Math.random() * 9999);
};

const formEl = document.getElementById("formID");
formEl.addEventListener("submit", handleSubmit);

function handleSubmit(event) {
  event.preventDefault();

  let foodName = event.target.foodName.value;
  let foodType = event.target.foodType.value;
  let price = event.target.foodPrice.value;

  const newFood = new food(foodName, foodType, price);

  newFood.fID();

  saveData();
}

function saveData() {
  let stringifiedData = JSON.stringify(allFood);
  localStorage.setItem("Food", stringifiedData);
}


"use strict";

const fdTable = document.getElementById('fTable');
const tableHead = document.getElementById('hdrTable');
var AllFood = [];

function Food(foodName, foodType, price) {
  this.foodName = foodName;
  this.foodType = foodType;
  this.price = price;
  AllFood.push(this);
}
Food.prototype.fID = function () {
  this.id = Math.floor(1111 + Math.random() * 9999);
};

table();

function table() {
  let headerID = document.createElement("th");
  headerID.textContent = "ID";

  let headerName = document.createElement("th");
  headerName.textContent = "Food Name";

  let headerType = document.createElement("th");
  headerType.textContent = "Type of Food";

  let headerPrice = document.createElement("th");
  headerPrice.textContent = "price";

  tableHead.appendChild(headerID);
  tableHead.appendChild(headerName);
  tableHead.appendChild(headerType);
  tableHead.appendChild(headerPrice);
}

Food.prototype.Render = function () {
  let row = document.createElement("tr");
  let id = document.createElement("td");
  let name = document.createElement("td");
  let type = document.createElement("td");
  let price = document.createElement("td");

  id.textContent = this.id;
  name.textContent = this.foodName;
  type.textContent = this.foodType;
  price.textContent = this.price;

  row.appendChild(id);
  row.appendChild(name);
  row.appendChild(type);
  row.appendChild(price);

  fdTable.appendChild(row);
};

getData();

function getData() {
  let retrivedData = localStorage.getItem("stringifiedData");
  let parsedData = JSON.parse(retrivedData);

  for (let i = 0; i < parsedData.length; i++) {
    let newFood = new Food.food(
      parsedData[i].foodName,
      parsedData[i].foodType,
      parsedData[i].price
    );
  }
  for (let i = 0; i < AllFood.length; i++) {
    AllFood[i].Render();
  }
}
*{
  margin: 0;
  padding: 0;
  box-sizing:border-box;
  font-family: Arial, Helvetica;
  }
  
  header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 50px;
    box-shadow: 0 1px 8px #ddd;
    background-color: #a2b9bc;
  }
  
  header li {
    list-style: none;
    display: inline-block;
    padding: 0 20px;
  }
  
  header a {
    text-decoration: none;
    color: #555;
    transition: all 0.3s ease 0s;
  }
  
  header a:hover {
    color: #b2dfdb;
  }
  
  #nav-Logo {
    margin-right:auto ;
    font-size: 1.5em;
  }


  /* start of main */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fafafa;
  min-height: 100vh;
}
/* end of main */
/* start of footer */
footer {
  display: flex;
  justify-content: space-around;
  
  
  padding: 20px;
  box-shadow: 0 1px 8px #ddd;
  background-color: #878f99;

  
}

.footer__headline {
  font-weight: bold;
  font-family: 'Gulzar', serif;
}

.footer__list {
  font-family: 'Gulzar', serif;
  list-style: none;
  padding: 0;
  margin: 0;
}


footer a {
  text-decoration: none;
  color: #555;
  transition: all 0.3s ease 0s;
  
}
footer li {
  margin: auto;

}

.copyDiv {
  background-color: black;
  color: aquamarine;
  text-align: center;
}


Contact__Card {
  width: 600px;
  height: 500px;
  border: 1px solid lightgray;
  border-radius: 1rem;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  grid-template-rows: 1fr 1fr 150px 1fr;
}

.Input__Container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  
}

.Text__Container {
  grid-column: span 2;
}

.Button__Container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Element styles */
.Input {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  overflow: visible;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.5rem;
  border: 2px solid lightblue;
  border-radius: 0.5rem;
  width: 100%;
}

.Input:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgb(173, 216, 230, 0.5);
}

.Message {
  resize: none;
}

.Label {
  padding-bottom: 0.25rem;
  font-weight: 600;
}

.Button {
  background-color: darkblue;
  border-color: #dbdbdb;
  border-width: 1px;
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
}

.Button:hover {
  border-color: #b5b5b5;
}

.Button:focus {
  outline: none;
  border-color: #485fc7;
  color: #363636;
  box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.25);
}

  
  /*Responsivnes */
  
  @media(max-width: 500px){
  
    footer{
      flex-direction:column;
    }
  }


  table{
    margin:0 auto ;
    border-collapse:collapse ;
    width: 50%;
   }
   td{
    text-align: center;
   }
   td ,th {
    text-align: center;
    padding: 15px;
    border-spacing:5px ;
   }
   table ,th ,td ,tr {
    border-bottom:1px solid black ;
   }
   th{
    background-color:  #8de679;
      color: #ddd;
   }
   tr:nth-child(even){background-color: #f2f2f2;}
  this is the form page




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="./style.css">
</head>
<body>
  
<header> <div id="nav-Logo">
  <h1><a  href="index.html"><img src="https://img.icons8.com/ios/50/000000/todo-list--v1.png"/> Resturant</a> </h1>
</div>
  <nav>
      <ul>
          <li><a href="/statistics.html">statistics</a></li>
          
          <li><a href="#">Contact us</a></li>
      </ul>
  </nav>
</header>
<main>

  <form id="formID">
    <div class="Contact__Card">
      <div class="Input__Container">
        <label for="foodName" class="Label" >Food</label>
        <input
          name="foodName"
          class="Input"
          type="text"
          placeholder="What would you like to add?"
          id="foodName"
          required
        />
      </div>

  <div class="input__Container">
    <label for="foodType">Choose Food type:</label>
<select class="Input" id="foodType" name="foodlist">
  <option value="Fruit and vegetables">Fruit and vegetables</option>
  <option value="Starchy food">Starchy food</option>
  <option value="Dairy">Dairy</option>
  <option value="Protein">Protein</option>
  <option value="Fat">Fat</option>
</select></div>

      <div class="Input__Container">
        <label for="price" class="Label">price</label>
        <input type="text" min="1" step="any"  class="Input" id="foodPrice" required/>

        
      </div>
      <br>
      <div class="Input__Container">
       
        <input type="submit" value="Submit"  class="Input"/>

        
      </div>
  
      
      
    </div>
  </form>

<br>
  <table id="fTable">
    <tr id="hdrTable">
      
    </tr>
 
  
    
  </table>

</main>
<footer> 
  <div>
    <h2 class="footer__headline">Pages</h2>
    <ul class="footer__list">
        <li><a href="index.html">Home</a></li>
        <li><a href="./statistics.html">statistics</a></li>
        
    </ul>
  </div>

  <div>
    <h2 class="footer__headline">Location</h2>
    <ul class="footer__list">
        <li>Amman, Jordan</li>
        <li>Phone : 07123456789</li>
       
    </ul>
  </div>
  <div>
    <h2 class="footer__headline">Social Media</h2>
    <ul class="footer__list">
    

      <li><a href=""><i class="fab fa-facebook-f"></i></a></li>
     <li><a href=""><i class="fab fa-twitter"></i></a></li>
     <li><a href=""><i class="fab fa-instagram"></i></a></li> 

    </ul>
  </div>
</footer>
<div class="copyDiv">
  &copy; Suhaib Alnaji
</div>
<script src=./app.js></script>
<script src="./statistics.js"></script>

</body>
</html>

and this is the page where i need my output to be showen

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="./style.css">
</head>
<body>
   
<header> <div id="nav-Logo">
  <h1><a  href="index.html"><img src="https://img.icons8.com/ios/50/000000/todo-list--v1.png"/> Resturant</a> </h1>
</div>
  <nav>
      <ul>
          <li><a href="about.html">About us</a></li>
          
          <li><a href="#">Contact us</a></li>
      </ul>
  </nav>
</header>
  <table id="fTable">
    <tr id="hdrTable">
      
    </tr>
 
  
    
  </table>


  <footer> 
    <div>
      <h2 class="footer__headline">Pages</h2>
      <ul class="footer__list">
          <li><a href="index.html">Home</a></li>
          <li><a href="./statistics.html">statistics</a></li>
          
      </ul>
    </div>
  
    <div>
      <h2 class="footer__headline">Location</h2>
      <ul class="footer__list">
          <li>Amman, Jordan</li>
          <li>Phone : 07123456789</li>
         
      </ul>
    </div>
    <div>
      <h2 class="footer__headline">Social Media</h2>
      <ul class="footer__list">
      
  
        <li><a href=""><i class="fab fa-facebook-f"></i></a></li>
       <li><a href=""><i class="fab fa-twitter"></i></a></li>
       <li><a href=""><i class="fab fa-instagram"></i></a></li> 
  
      </ul>
    </div>
  </footer>
  <div class="copyDiv">
    &copy; Suhaib Alnaji
  </div>
  
<script src="./statistics.js"></script>
</body>
</html>