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

              
                <!-- responsive-table -->
<table class="responsive-table">
  <tr>
    <th>Header001(th)</th>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
  <tr>
    <th>Header002(th)</th>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
  <tr>
    <th>Header003(th)</th>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
  <tr>
    <th>Header004(th)</th>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
</table>
              
            
!

CSS

              
                /* 通常サイズのブラウザに適用する基本的なテーブルのスタイル */
table{
  border-collapse: collapse; /* セルの境界線を重ね合わせるため、ボーダーを重ねる */
  width: 100%; /* テーブルの幅を100%に設定 */
}

.responsive-table th,
.responsive-table td{
  padding: 15px; /* セル内のコンテンツとセルの境界線の間に余白を設ける */
  border: solid 1px #ccc; /* セルの境界線のスタイルを設定 */
  text-align:center; /* セル内のテキストを中央揃えに設定 */
  box-sizing:border-box; /* ボックスのサイズをコンテンツボックスに設定 */
}

.responsive-table th {
  width:30%;
  background: #333; /* 背景色を設定 */
  color: #fff; /* テキスト色 */
}

/* ブラウザサイズが600px以下になったときのスタイル */
@media screen and (max-width: 600px) {
  .responsive-table {
    width: 100%; /* テーブルの幅を100%に設定 */
  }
  
.responsive-table th,
.responsive-table td {
    display: block; /* ブロック要素として表示 */
    width: 100%; /* 幅を100%に設定 */
    border-bottom:none; /* セルの下部の境界線を削除 */
  }
  
  .responsive-table tr:last-child{
    border-bottom: solid 1px #ccc; /* 最後の行の下部に境界線を追加 */
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console