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

              
                <h2>模擬表格</h2>

<div role="table" aria-label="tax" aria-describedby="tax_table_desc"> <!-- table -->
  <div id="tax_table_desc">所得稅課稅級距累進稅率</div> <!-- caption -->
  <div role="rowgroup"> <!-- thead -->
    <div role="row"> <!-- tr -->
      <span role="columnheader">所得淨額</span> <!-- th -->
      <span role="columnheader">稅率</span>
      <span role="columnheader">累進差額</span>
    </div>
  </div>
  <div role="rowgroup"> <!-- tbody -->
    <div role="row">
      <span role="cell">NT$ 0 ~ NT$ 540,000</span> <!-- td -->
      <span role="cell">5%</span>
      <span role="cell">NT$ 0</span>
    </div>
    <div role="row">
      <span role="cell">NT$ 540,001 ~ NT$ 1,210,000</span>
      <span role="cell">12%</span>
      <span role="cell">NT$ 37,800</span>
    </div>
    <div role="row">
      <span role="cell">NT$ 1,210,001 ~ NT$ 2,420,000</span>
      <span role="cell">20%</span>
      <span role="cell">NT$ 134,600</span>
    </div>
    <div role="row">
      <span role="cell">NT$ 2,420,001 ~ NT$ 4,530,000</span>
      <span role="cell">30%</span>
      <span role="cell">NT$ 376,600</span>
    </div>
    <div role="row">
      <span role="cell">NT$ 4,530,001 以上</span>
      <span role="cell">40%</span>
      <span role="cell">NT$ 829,600</span>
    </div>
  </div>
</div>

<hr>

<h2>模擬複雜表格</h2>
<div role="table">
  <div role="rowgroup">
    <div role="row">
      <div role="columnheader" aria-colspan="2">項目</div>
      <div role="columnheader">修法前</div>
      <div role="columnheader">修法後</div>
    </div>
  </div>
  
  <div role="rowgroup">
    <div role="row">
      <div role="rowheader" aria-rowspan="2">標準扣除額</div>
      <div role="columnheader">單身者</div>
      <div role="cell" aria-colindex="3">9 萬元</div>
      <div role="cell" aria-colindex="4">12 萬元</div>
    </div>
    <div role="row">
      <div aria-rowspan="2"></div>
      <div role="columnheader">與配偶合併申報</div>
      <div role="cell" aria-colindex="3">18 萬元</div>
      <div role="cell" aria-colindex="4">24 萬元</div>
    </div>
  </div>

  <div role="rowgroup">
    <div role="row">
      <div role="rowheader" aria-colspan="2">薪資所得特別扣除額</div>
      <div role="cell" aria-colindex="3">12.8 萬元</div>
      <div role="cell" aria-colindex="4">20 萬元</div>
    </div>
    <div role="row">
      <div role="rowheader" aria-colspan="2">身心障礙特別扣除額</div>
      <div role="cell" aria-colindex="3">12.8 萬元</div>
      <div role="cell" aria-colindex="4">20 萬元</div>
    </div>
    <div role="row">
      <div role="rowheader" aria-colspan="2">幼兒學前特別扣除額</div>
      <div role="cell" aria-colindex="3">2.5 萬元</div>
      <div role="cell" aria-colindex="4">12 萬元</div>
    </div>
    <div role="row">
      <div role="rowheader" aria-colspan="2">綜合所得淨額超過 1 千萬元部分稅率</div>
      <div role="cell" aria-colindex="3">45%</div>
      <div role="cell" aria-colindex="4">刪除</div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                [role="table"] {
  display: table;
}

[role="table"] > div[id] {
  display: table-caption;
  font-style: italic;
}

[role="table"] [role="row"]{
  display: table-row;
}

[role="table"] [role="cell"],
[role="table"] [role="columnheader"],
[role="table"] [role="rowheader"] {
  display: table-cell;
  padding: 0.125em 0.25em;
  width: 8em;
}

[role="table"] [role="columnheader"]:nth-child(1),
[role="table"] [role="cell"]:nth-child(1){
  width: 50%;
}

[role="table"] [role="columnheader"] {
  font-weight: bold;
  border-bottom: thin solid #888;
}

[role="table"] [role="rowgroup"]:last-child [role="row"]:nth-child(odd) {
  background-color: #ddd;
}

[role="table"] [aria-colspan="2"] {
  display: table-cell;
  width: 50%; /* 橫跨兩列 */
}

hr{margin:1em 0;}
              
            
!

JS

              
                
              
            
!
999px

Console