Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Auto Save

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.

HTML

              
                <body>
  <table id="tbl">
      <tr>
        <th>比較</th><th>テックアカデミー</th><th>テックキャンプ</th>
      </tr>
      <tr>
        <th>学習方式</th><td>オンライン</td><td>教室</td>
      </tr>
      <tr>
        <th>言語</th><td>いろいろ</td><td>Ruby on Rails</td>
      </tr>
      <tr>
        <th>料金</th><td>20万円</td><td>10万円</td>
      </tr>
    </tbody>
  </table>
</body>
              
            
!

CSS

              
                    table {
      background-color: #ffe;
      border-collapse: collapse;
    }
    table th {
      background-color: #eee;
    }
    table th, table td {
      border: solid 1px #aaa;
      padding:15px;
    }
              
            
!

JS

              
                var mytable = document.getElementById("tbl");

//1つ目のやり方
var mytr = mytable.insertRow(1); //引数-1 : 表の一番最後に1行追加

//thセルの追加
var myth = document.createElement("th");
myth.innerHTML = "URL";
mytr.appendChild(myth);

//tdセルの追加
var mycell1 = mytr.insertCell(1);
var mycell2 = mytr.insertCell(2);

//textContentでもいいしinnnerHTMLでもいいし
mycell1.textContent = "techacademy.jp";
mycell2.innerHTML = "<span style=color:#aaf;>tech-camp.in</span>";

//2つ目のやり方
var mytr2 = mytable.insertRow(-1); //引数-1 : 表の一番最後に1行追加

var myth2 = document.createElement("th");
var myth2Txt = document.createTextNode("評価");
myth2.appendChild(myth2Txt);
mytr2.appendChild(myth2);

mycell3 = mytr2.insertCell(1);
mycell3Txt = document.createTextNode("●●●●");
mycell3.appendChild(mycell3Txt);

mycell4 = mytr2.insertCell(2);
mycell4Txt = document.createTextNode("★★★★");
mycell4.appendChild(mycell4Txt);

              
            
!
999px

Console