Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!DOCTYPE html>
<html lang="en">
<title>Doing the assignment</title>
  <meta charset="utf-8"/>
  <p>Optional Project</p>
  <button onclick="search();">Create a table from remote data</button>
  <div id="users"></div>



                table {
  margin-top: 20px;
table, tr, td {
  border: 1px solid;
  border-collapse: collapse


                  function search() {    
    var queryURL = "";
    var xhr = new XMLHttpRequest();'GET', queryURL, true);

    // called when the response is arrived
    xhr.onload = function(e) {
      var jsonResponse = xhr.response;
      // turn the response into a JavaScript object
      var users = JSON.parse(jsonResponse);
    // in case of error
    xhr.onerror = function(err) {
      console.log("Error: " + err);
    // sends the request
function displayUsersAsATable(users) {
    // users is a JavaScript object
    // empty the div that contains the results
    var usersDiv = document.getElementById("users");
    usersDiv.innerHTML = "";
    // creates and populate the table with users
    var table = document.createElement("table");
  //Creating a Header//
  var header = table.insertRow();  
  var nameH = header.insertCell();
  nameH.innerHTML = "Name";
  var Position = header.insertCell();
  Position.innerHTML = "Position";
  var city = header.insertCell();
  city.innerHTML = "City";
  var aage = header.insertCell();
  aage.innerHTML = "Age"
  var Datein = header.insertCell();
  Datein.innerHTML = "Date in";
  var MSalary = header.insertCell();
  MSalary.innerHTML = "Year Salary";
    // iterate on the array of users {
        // creates a row
        var row = table.insertRow();
        // insert cells in the row
        var nameCell = row.insertCell();
        nameCell.innerHTML = currentUser[0];
        var Jobcell = row.insertCell();
        Jobcell.innerHTML = currentUser[1]
        var cityCell = row.insertCell();
        cityCell.innerHTML = currentUser[2];
        var Age = row.insertCell();
        Age.innerHTML = currentUser[3];
        var In = row.insertCell();
        In.innerHTML = currentUser[4];
        var Salary = row.insertCell();
        Salary.innerHTML = currentUser[5];
     // adds the table to the div