cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              

<div class="container">
    <h2 class="title">Multiplication Table</h2>
    <div class="button">
      <a href="https://phe0nix.github.io/" id="home" class="button">
        <span>Home</span>
      </a>
      <a href="https://github.com/Phe0nix/multiplication-table" id="view-on-github" class="button">
        <span>View on GitHub</span>
      </a>
    </div>
    <input type="text" placeholder="Wanna See Magic! Then Type any number"/>
<div class="result"></div>
  </div>
            
          
!
            
              :root{
  --background: #6a6af0;
}
.container{
  max-width: 400px;
  margin: auto;
  width: 100%;
  padding: 10px;
  font-family: Helvetica;
}
.title{
  text-align: center;
}
.button{
  text-align: center;
  margin-bottom: 20px;
}
.button a.button {
    display: inline-block;
    padding: 12px 30px;
    margin-right: 14px;
    font-size: 15px;
  text-decoration: none;
    font-weight: bold;
    line-height: 25px;
    color: #303030;
    background: #fdfdfd;
    background: -moz-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fdfdfd), color-stop(100%, #f2f2f2));
    background: -webkit-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%);
    background: -o-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%);
    background: -ms-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%);
    background: linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f2f2f2',GradientType=0 );
    border-top: solid 1px #cbcbcb;
    border-right: solid 1px #b7b7b7;
    border-bottom: solid 1px #b3b3b3;
    border-left: solid 1px #b7b7b7;
    border-radius: 30px;
    -webkit-box-shadow: 10px 10px 5px #888;
    -moz-box-shadow: 10px 10px 5px #888;
    box-shadow: 0px 1px 5px #e8e8e8;
    -moz-border-radius: 30px;
    -webkit-border-radius: 30px;
    transition: 0.2s linear;
}
#home span {
    background: transparent url(https://avatars0.githubusercontent.com/u/9951055) 1px 50% no-repeat;
  background-size: 20px;
}
#view-on-github span {
    background: transparent url(https://phe0nix.github.io/assets/images/octocat-icon.png) 0 50% no-repeat;
}
a.button span {
    display: block;
    height: 23px;
    padding-left: 35px;
}
input{
  width: inherit;
  height: 40px;
  box-sizing: border-box;
  padding: 5px 15px;
  font-size: 18px;
  margin-bottom: 10px;
}
.head{
  background: var(--background);
  padding: 10px;
  color: white;
  line-height: 25px;
  font-size: 18px;
}
.value{
  padding: 0 10px;
  margin-top: 0px;
  border-right: 1px solid var(--background);
  border-left: 1px solid var(--background);
  margin-bottom: 0;
  padding: 6px 10px;
  font-size: 18px;
}
.value:last-child{
  border-bottom: 1px solid var(--background);
}
.value span{
  margin: 4px;
}

@media screen and (max-width: 400px){
  body{
    overflow-x: hidden;
  }
  .button a.button{
    display: inline-block;
    padding: 5px 14px;
    font-size: 13px;
    text-decoration: none;
    font-weight: bold;
    line-height: 25px;
    color: #303030;
    transition: 0.2s linear;
  }
  .button a.button:not(:last-child){
    margin-right: 6px;
  }
  input, .result{
    width: 94%;
  }
  .head, .value{
    font-size: 15px;
  }
  ::-webkit-input-placeholder {
    font-size: 14px;
  }
  ::-moz-placeholder {
    font-size: 14px;
  }
  :-moz-placeholder {
    font-size: 14px;
  }
  :-ms-input-placeholder {
    font-size: 14px;
  }
}

            
          
!
            
              var number = document.querySelector("input"), i,
    output='',
    rsult = document.querySelector(".result");

function multiplication(e){
  if(isNaN(number.value)){
  rsult.innerHTML = `<div class='head'>You know, what is number,
 right? (example: 1, 4, 6)</div>`;
  }
  else if(number.value.length==0){
    rsult.innerHTML = `<div class='head'>Oops!! I don't see anything up 
there, Try enter some Numbers and See the Magic!</div>`;
  }
  else{
      output='';
  for(i=1;i<11;i++){
    output += `<p class='value'>${number.value}<span>x<span>${i} = ${number.value*i}</p>`;
  }
  rsult.innerHTML = `<div class='head'>This is ${number.value}'s Multiplication Table</div>
${output}`;
  }
}

number.addEventListener("keyup", multiplication);
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console