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

              
                <div id="wrap">
  
  <h1>Responsive <span>Table</span> Layout Sample</h1>
  <p class="description">レスポンシブデザインのテーブルレイアウト例</p>
    
  <div class="tableBlock pattern03">
  <table>
    <caption>レスポンシブテーブル パターン3:縦並び</caption>
    <tbody>
    <tr>
      <th>見出し1</th>
      <td>テキスト1-1</td>
      <td>テキスト1-2</td>
    </tr>
    <tr>
      <th>見出し2</th>
      <td>テキスト2-1</td>
      <td>テキスト2-2</td>
    </tr>
    <tr>
      <th>見出し3</th>
      <td>テキスト3-1</td>
      <td>テキスト3-2</td>
    </tr>
    </tbody>
  </table>
  <!-- /.tableBlock pattern03 --></div>
  
<!-- /#wrap --></div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Righteous);

#wrap {
  margin:2em auto;
  font-family: Arial, Roboto, “Droid Sans”, “游ゴシック”, YuGothic, “ヒラギノ角ゴ ProN W3”, “Hiragino Kaku Gothic ProN”, “メイリオ”, Meiryo, sans-serif;
  max-width:960px;
}
h1, h2 {
  text-align:center;
  font-family: 'Righteous', cursive;
}
h1 {
  font-size: 2.5em;
}
h1 span {
  color:#ffc045;
}
p.description {
  margin-top: 1em;
  letter-spacing:2px;
  text-align:center;
}
.btnList {
  margin-top: 2em;
  text-align:center;
}
.btnList li {
  display:inline-block;
}

/* 基本スタイル */
.tableBlock {
  margin-top:2em;
}
table {
  width:100%;
  table-layout:fixed;
  -webkit-box-sizing:border-box;
  box-sizing:border-box;
  border:1px solid #cfcfcf;
}
table caption {
  padding:1em;
  line-height: 1.5;
  text-align: left;
  background:#ffc045;
}
table tr th {
  background:#f2f2f2;
}
table tr th,
table tr td {
  padding:1em;
  line-height: 1.5;
  text-align:left;
  border:1px solid #cfcfcf;
}

/* Tablet */
@media screen and (max-width:768px){
  
  /* パターン3:テーブルセルを縦並びに */
  .tableBlock.pattern03 table,
  .tableBlock.pattern03 table caption,
  .tableBlock.pattern03 table thead,
  .tableBlock.pattern03 table tbody,
  .tableBlock.pattern03 table tr,
  .tableBlock.pattern03 table tr th,
  .tableBlock.pattern03 table tr td {
    display:block;
  }
  .tableBlock.pattern03 table tr th,
  .tableBlock.pattern03 table tr td {
    margin:-1px; /* borderが二重になるのを防ぐ */
  }
  
/* Tablet */ }


              
            
!

JS

              
                
              
            
!
999px

Console