Full Code of JackGit/table2excel.js for AI

master 0c9b3db89f2a cached
31 files
91.6 KB
32.2k tokens
37 symbols
1 requests
Download .txt
Repository: JackGit/table2excel.js
Branch: master
Commit: 0c9b3db89f2a
Files: 31
Total size: 91.6 KB

Directory structure:
gitextract_ca7o4bbr/

├── .babelrc
├── .gitignore
├── README.md
├── dist/
│   └── table2excel.core.js
├── docs/
│   ├── index.html
│   └── js/
│       └── table2excel.core.js
├── es5/
│   ├── constants.js
│   ├── index.js
│   ├── plugins/
│   │   ├── alignment.js
│   │   ├── autoWidth.js
│   │   ├── fill.js
│   │   ├── font.js
│   │   ├── form.js
│   │   ├── hyperlink.js
│   │   └── index.js
│   ├── table2excel.js
│   └── utils.js
├── package.json
├── src/
│   ├── constants.js
│   ├── index.js
│   ├── plugins/
│   │   ├── alignment.js
│   │   ├── autoWidth.js
│   │   ├── fill.js
│   │   ├── font.js
│   │   ├── form.js
│   │   ├── hyperlink.js
│   │   └── index.js
│   ├── table2excel.js
│   └── utils.js
├── webpack.core.config.js
└── webpack.umd.config.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "presets":[
    "es2015",
    "stage-1"
  ]
}

================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


================================================
FILE: README.md
================================================
# Table2Excel.js

This is a library to export html tables to excel sheets.

## Precondition

It has to be a row * column table

## Features

1. able to export with width, alignment and colors
2. extendable

## Dependencies

[ExcelJS](https://github.com/guyonroche/exceljs)

[FileSaver.js](https://github.com/eligrey/FileSaver.js)

## Live Demo

[Demo](https://jackgit.github.io/table2excel.js/index.html)

## Include table2excel.js

### npm

`ExcelJS` is peer dependency to `table2excel.js`, so you need to install exceljs first:

```bash
npm i exceljs
```

then, install table2excel.js:

```bash
npm i table2excel.js
```

use in your code like:

```js
import Table2Excel from 'table2excel.js'
new Table2Excel('table').export()
```

you may also need a config in webpack:

```js
node: { fs: 'empty' }
```

### table2excel.min.js (with ExcelJS packed)

```html
<script src="path/to/table2excel.min.js"></script>
```

### table2excel.core.js (without ExcelJS packed)

```html
<script src="path/to/exceljs.min.js"></script>
<script src="path/to/table2excel.core.js"></script>
```

## Basic Usage

```js
const table2Excel = new Table2Excel(selector, options)  // new Table2Excel('table')
table2Excel.export(fileName, extension) // table2Excel.export('my-exported-table', 'xlsx')
```

`extension` can be `'xls'` or `'xlsx'`, default as `'xlsx'`

### selector

It's optional, and defaulted as `'table'`

### options

It's optional, and defaulted as:

```js
{
  workbook: {
    views: [{
      x: 0, y: 0, width: 10000, height: 20000,
      firstSheet: 0, activeTab: 1, visibility: 'visible'
    }]
  },
  widthRatio: .14,
  plugins: [
    Table2Excel.plugins.fontPlugin,
    Table2Excel.plugins.fillPlugin,
    Table2Excel.plugins.formPlugin,
    Table2Excel.plugins.alignmentPlugin,
    Table2Excel.plugins.hyperlinkPlugin,
    Table2Excel.plugins.autoWidthPlugin
  ]
}
```

`workbook` is options used while creating a workbook, please refer [exceljs#create-a-workbook](https://github.com/guyonroche/exceljs#create-a-workbook) for details.

`widthRatio` is a ratio that will be used while converting `width` style of html table cells to width of sheet cells.

## Plugins

Plugin helps to extend the ability of transforming table to excel.

Build-in plugins can be access like:

```js
Table2Excel.plugins.fontPlugin,
Table2Excel.plugins.fillPlugin,
Table2Excel.plugins.formPlugin,
Table2Excel.plugins.alignmentPlugin,
Table2Excel.plugins.hyperlinkPlugin,
Table2Excel.plugins.autoWidthPlugin
```

A plugin can be defined to join different phase of table to excel process, and in different phase, plugin is able to access different objects from context.

```js
{
  /**
   * after an empty workbook created
   * @param  {ExcelJS.Workbook} context.workbook
   * @param  {NodeList} context.tables   
   */
  workbookCreated ({ workbook, tables }) {},
  /**
   * after an empty worksheet created
   * @param  {ExcelJS.Workbook} workbook
   * @param  {NodeList} tables
   * @param  {ExcelJS.Worksheet} worksheet
   * @param  {HTMLTableElement} table
   */
  worksheetCreated ({ workbook, tables, worksheet, table }) {},
  /**
   * after a worksheet been filled with data from table
   * @param  {ExcelJS.Workbook} workbook
   * @param  {NodeList} tables
   * @param  {ExcelJS.Worksheet} worksheet
   * @param  {HTMLTableElement} table
   */
  worksheetCompleted ({ workbook, tables, worksheet, table }) {},
  /**
   * after an cell of worksheet created
   * @param  {ExcelJS.Workbook} workbook
   * @param  {NodeList} tables
   * @param  {ExcelJS.Worksheet} worksheet
   * @param  {HTMLTableElement} table
   * @param  {ExcelJS.Cell} workcell
   * @param  {HTMLTableCellElement} cell
   * @param  {colRange} [from, to]
   * @param  {rowRange} [from, to]
   */
  workcellCreated ({ workbook, tables, worksheet, table, workcell, cell, cellStyle, colRange, rowRange }) {}
}
```


Example 1, you can define a plugin to make some rows or columns hidden of exported excel:

```js
const table2Excel = new Table2Excel('table', {
  plugins: [{
    worksheetCompleted ({ workbook, tables, worksheet, table }) {
      worksheet.getRow(1).hidden = true
      worksheet.getColumn(1).hidden = true
    }
  }]
})
```

Example 2, you can add your customized cell parser for your table:

```js
const table2Excel = new Table2Excel('table', {
  plugins: [{
    workcellCreated ({ workbook, tables, worksheet, table, workcell, cell, cellStyle, rowRange, colRange }) {
      workcell.value = { text: '', link: '' }
      workcell.style = {
        ...workcell.style,
        font: {},
        color: {}
      }
    }
  }]
})
```


================================================
FILE: dist/table2excel.core.js
================================================
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ExcelJS")):"function"==typeof define&&define.amd?define(["ExcelJS"],t):"object"==typeof exports?exports.Table2Excel=t(require("ExcelJS")):e.Table2Excel=t(e.ExcelJS)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argb=t.mergeCells=t.cellPosition=t.columnIndex=t.saveAsExcel=void 0;var r=n(1),o=n(6),l=(t.saveAsExcel=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"xlsx",l=r.MIME_TYPES[n];l?e.xlsx.writeBuffer().then(function(e){(0,o.saveAs)(new Blob([e.buffer],{type:l}),t+"."+n)}):console.error(n+" file extension is not supported")},function(e){var t="A".charCodeAt(0);return String.fromCharCode(t+e-1)}),i=t.columnIndex=function(e){var t=void 0;if((e+=1)<=26)t=l(e);else{var n=e%26,r=Math.floor(e/26);t=0===n?l(r-1)+l(26):l(r)+l(n)}return t},a=t.cellPosition=function(e,t){return""+i(e)+(t+1)};t.mergeCells=function(e,t,n,r,o){var l=a(t,n),i=a(r,o);return e.mergeCells(l,i),e.getCell(l)},t.argb=function(e){var t=e.split("(")[1].split(")")[0].split(",").map(function(e,t){return 3===t?255*e:e});return 3===t.length&&t.push(255),t.unshift(t.pop()),t.map(function(e){var t=parseInt(e).toString(16);return 1===t.length?"0"+t:t}).join("").toUpperCase()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MIME_TYPES={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},t.WIDTH_RATIO=.14},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(9)),o=c(n(10)),l=c(n(11)),i=c(n(12)),a=c(n(13)),u=c(n(14));function c(e){return e&&e.__esModule?e:{default:e}}t.default={fontPlugin:r.default,fillPlugin:o.default,formPlugin:l.default,alignmentPlugin:i.default,hyperlinkPlugin:a.default,autoWidthPlugin:u.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(4)),o=i(n(2)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0));function i(e){return e&&e.__esModule?e:{default:e}}r.default.plugins=o.default,r.default.utils=l,t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(5)),l=n(0),i=n(1),a=u(n(2));function u(e){return e&&e.__esModule?e:{default:e}}var c=["workbookCreated","worksheetCreated","worksheetCompleted","workcellCreated"],f={workbook:{views:[{x:0,y:0,width:1e4,height:2e4,firstSheet:0,activeTab:1,visibility:"visible"}]},widthRatio:i.WIDTH_RATIO,plugins:[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Object.values(a.default)))},s=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"table",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tables=Array.from("string"==typeof n?document.querySelectorAll(n):n),this.options=Object.assign({},f,r),this.plugins={},c.forEach(function(e){t.plugins[e]=t.options.plugins.filter(function(t){return t[e]}).map(function(t){return t[e]})}),this.pluginContext={}}return r(e,[{key:"_invokePlugin",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.pluginContext=Object.assign({},this.pluginContext,n),this.plugins[e].forEach(function(e){return e.call(t,t.pluginContext)})}},{key:"toExcel",value:function(){var e=this,t=this.tables,n=this.options,r=new o.default.Workbook;return Object.assign(r,n),this._invokePlugin("workbookCreated",{workbook:r,tables:t}),t.forEach(function(t,n){var o=r.addWorksheet("Sheet "+(n+1));e._invokePlugin("worksheetCreated",{worksheet:o,table:t}),e.toSheet(t,o),e._invokePlugin("worksheetCompleted",{worksheet:o,table:t})}),this.workbook=r}},{key:"toSheet",value:function(e,t){var n=this,r=e.rows.length,o=0;if(e.rows.length>0)for(var i=0;i<e.rows[0].cells.length;i++)o+=e.rows[0].cells[i].colSpan;var a=[];Array.from(e.rows).forEach(function(e){Array.from(e.cells).forEach(function(e){a.push({rowRange:{},colRange:{},el:e})})});for(var u=[],c=0;c<r;c++){for(var f=[],s=0;s<o;s++)f.push({cell:null});u.push(f)}for(var d=0,p=0;p<r;p++)for(var v=0;v<o;v++)if(!u[p][v].cell){var h=a[d++],g=h.el,b=g.rowSpan,w=g.colSpan;h.rowRange={from:p,to:p},h.colRange={from:v,to:v};for(var y=p;y<p+b;y++)for(var m=v;m<v+w;m++)u[y][m].cell=h,h.colRange.to=m,h.rowRange.to=y}a.forEach(function(e){var r=e.rowRange,o=e.colRange,i=e.el,a=i.innerText,u=(0,l.mergeCells)(t,o.from,r.from,o.to,r.to),c=getComputedStyle(i);u.value=a,n._invokePlugin("workcellCreated",{workcell:u,cell:i,rowRange:r,colRange:o,cellStyle:c})})}},{key:"export",value:function(e,t){this.workbook||this.toExcel(),(0,l.saveAsExcel)(this.workbook,e,t)}}]),e}();t.default=s},function(t,n){t.exports=e},function(e,t,n){var r,o=o||function(e){"use strict";if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=function(){return e.URL||e.webkitURL||e},n=e.document.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in n,o=/constructor/i.test(e.HTMLElement)||e.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent),i=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},a=function(e){setTimeout(function(){"string"==typeof e?t().revokeObjectURL(e):e.remove()},4e4)},u=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},c=function(c,f,s){s||(c=u(c));var d,p=this,v="application/octet-stream"===c.type,h=function(){!function(e,t,n){for(var r=(t=[].concat(t)).length;r--;){var o=e["on"+t[r]];if("function"==typeof o)try{o.call(e,n||e)}catch(e){i(e)}}}(p,"writestart progress write writeend".split(" "))};if(p.readyState=p.INIT,r)return d=t().createObjectURL(c),void setTimeout(function(){n.href=d,n.download=f,function(e){var t=new MouseEvent("click");e.dispatchEvent(t)}(n),h(),a(d),p.readyState=p.DONE});!function(){if((l||v&&o)&&e.FileReader){var n=new FileReader;return n.onloadend=function(){var t=l?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,p.readyState=p.DONE,h()},n.readAsDataURL(c),void(p.readyState=p.INIT)}d||(d=t().createObjectURL(c)),v?e.location.href=d:e.open(d,"_blank")||(e.location.href=d);p.readyState=p.DONE,h(),a(d)}()},f=c.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return t=t||e.name||"download",n||(e=u(e)),navigator.msSaveOrOpenBlob(e,t)}:(f.abort=function(){},f.readyState=f.INIT=0,f.WRITING=1,f.DONE=2,f.error=f.onwritestart=f.onprogress=f.onwrite=f.onabort=f.onerror=f.onwriteend=null,function(e,t,n){return new c(e,t||e.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */void 0!==e&&e.exports?e.exports.saveAs=o:null!==n(7)&&null!==n(8)&&(void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r))},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(0);t.default={workcellCreated:function(e){var t=e.workcell,n=e.cellStyle,l=n.fontWeight;t.font=r({},t.font||{},{name:n.fontFamily,color:{argb:(0,o.argb)(n.color)},bold:"bold"===l||+l>600})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(0);t.default={workcellCreated:function(e){var t=e.workcell,n=e.cellStyle,l=(0,o.argb)(n.backgroundColor);t.fill=r({},t.fill||{},"00000000"===l?{type:"pattern",pattern:"none"}:{type:"pattern",pattern:"solid",fgColor:{argb:l}})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={workcellCreated:function(e){var t=e.workcell,n=e.cell.children[0];n&&["INPUT","SELECT","TEXTAREA"].includes(n.tagName)&&(t.value=n.value)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default={workcellCreated:function(e){var t=e.workcell,n=e.cellStyle,o=n.verticalAlign,l=n.textAlign;t.alignment=r({},t.alignment||{},{vertical:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=["top","middle","bottom"],n=0;n<t.length;n++)if(e.includes(t[n]))return t[n];return{baseline:"middle",super:"top",sub:"bottom"}[e]}(o),horizontal:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=["right","left","center","justify"],n=0;n<t.length;n++)if(e.includes(t[n]))return t[n]}(l)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={workcellCreated:function(e){var t=e.workcell,n=e.cell.children[0];n&&"A"===n.tagName&&(t.value={text:n.innerText,hyperlink:n.href})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={workcellCreated:function(e){var t=e.worksheet,n=e.colRange,r=(e.cell,e.cellStyle);n.from===n.to&&"auto"!==r.width&&(t.getColumn(n.from+1).width=+r.width.split("px")[0]*this.options.widthRatio)}}}]).default});

================================================
FILE: docs/index.html
================================================
<html><head>
    <meta charset="utf-8">
    <title></title>
    <script src="js/exceljs.min.js"></script>
    <script src="js/table2excel.core.js"></script>
    <script>
    function exportTables () {
      new Table2Excel('table').export()
    }
    </script>
  </head>
  <body>
    <button onclick="exportTables()">export</button>






<h1>Table 1</h1>
<table border="1">
  <tbody>
    <tr>
      <td colspan="2">1</td>
      <td rowspan="2"><a href="//github.com">github</a></td>
      <td>
        <select>
          <option>option 1</option>
          <option>option 2</option>
        </select>
      </td>
    </tr>
    <tr>
      <td><input value="input value"></td>
      <td><textarea>textarea</textarea></td>
      <td>c</td>
    </tr>
  </tbody>
</table>

<h1>ASCII Table</h1>
<table class="wikitable" style="text-align: center" border="1">
<tbody><tr>
<th rowspan="2"><a href="/wiki/Binary_numeral_system" class="mw-redirect" title="Binary numeral system">Binary</a></th>
<th rowspan="2"><a href="/wiki/Octal" title="Octal">Oct</a></th>
<th rowspan="2"><a href="/wiki/Decimal" title="Decimal">Dec</a></th>
<th rowspan="2"><a href="/wiki/Hexadecimal" title="Hexadecimal">Hex</a></th>
<th colspan="3">Abbreviation</th>
<th rowspan="2"><sup id="cite_ref-39" class="reference"><a href="#cite_note-39">[b]</a></sup></th>
<th rowspan="2"><sup id="cite_ref-40" class="reference"><a href="#cite_note-40">[c]</a></sup></th>
<th rowspan="2"><sup id="cite_ref-41" class="reference"><a href="#cite_note-41">[d]</a></sup></th>
<th rowspan="2">Name ('67)</th>
</tr>
<tr>
<th>'63</th>
<th>'65</th>
<th>'67</th>
</tr>
<tr>
<td>000 0000</td>
<td style="background:lightblue;">000</td>
<td style="background:#CFF;">0</td>
<td style="background:lightblue;">00</td>
<td>NULL</td>
<td colspan="2">NUL</td>
<td style="font-size:large;">␀</td>
<td><code><a href="/wiki/%5E@" class="mw-redirect" title="^@">^@</a></code></td>
<td><code><a href="/wiki/%5C0" class="mw-redirect" title="\0">\0</a></code></td>
<td style="text-align:left;"><a href="/wiki/Null_character" title="Null character">Null</a></td>
</tr>
<tr>
<td>000 0001</td>
<td style="background:lightblue;">001</td>
<td style="background:#CFF;">1</td>
<td style="background:lightblue;">01</td>
<td>SOM</td>
<td colspan="2">SOH</td>
<td style="font-size:large;">␁</td>
<td><code><a href="/wiki/%5EA" class="mw-redirect" title="^A">^A</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Start_of_Heading" class="mw-redirect" title="Start of Heading">Start of Heading</a></td>
</tr>
<tr>
<td>000 0010</td>
<td style="background:lightblue;">002</td>
<td style="background:#CFF;">2</td>
<td style="background:lightblue;">02</td>
<td>EOA</td>
<td colspan="2">STX</td>
<td style="font-size:large;">␂</td>
<td><code><a href="/wiki/%5EB" class="mw-redirect" title="^B">^B</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Start_of_Text" class="mw-redirect" title="Start of Text">Start of Text</a></td>
</tr>
<tr>
<td>000 0011</td>
<td style="background:lightblue;">003</td>
<td style="background:#CFF;">3</td>
<td style="background:lightblue;">03</td>
<td>EOM</td>
<td colspan="2">ETX</td>
<td style="font-size:large;">␃</td>
<td><code><a href="/wiki/%5EC" class="mw-redirect" title="^C">^C</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/End-of-Text_character" title="End-of-Text character">End of Text</a></td>
</tr>
<tr>
<td>000 0100</td>
<td style="background:lightblue;">004</td>
<td style="background:#CFF;">4</td>
<td style="background:lightblue;">04</td>
<td colspan="3">EOT</td>
<td style="font-size:large;">␄</td>
<td><code><a href="/wiki/%5ED" class="mw-redirect" title="^D">^D</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/End-of-Transmission_character" title="End-of-Transmission character">End of Transmission</a></td>
</tr>
<tr>
<td>000 0101</td>
<td style="background:lightblue;">005</td>
<td style="background:#CFF;">5</td>
<td style="background:lightblue;">05</td>
<td>WRU</td>
<td colspan="2">ENQ</td>
<td style="font-size:large;">␅</td>
<td><code><a href="/wiki/%5EE" class="mw-redirect" title="^E">^E</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Enquiry_character" title="Enquiry character">Enquiry</a></td>
</tr>
<tr>
<td>000 0110</td>
<td style="background:lightblue;">006</td>
<td style="background:#CFF;">6</td>
<td style="background:lightblue;">06</td>
<td>RU</td>
<td colspan="2">ACK</td>
<td style="font-size:large;">␆</td>
<td><code><a href="/wiki/%5EF" class="mw-redirect" title="^F">^F</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Acknowledge_character" class="mw-redirect" title="Acknowledge character">Acknowledgement</a></td>
</tr>
<tr>
<td>000 0111</td>
<td style="background:lightblue;">007</td>
<td style="background:#CFF;">7</td>
<td style="background:lightblue;">07</td>
<td>BELL</td>
<td colspan="2">BEL</td>
<td style="font-size:large;">␇</td>
<td><code><a href="/wiki/%5EG" class="mw-redirect" title="^G">^G</a></code></td>
<td><code><a href="/wiki/%5Ca" class="mw-redirect" title="\a">\a</a></code></td>
<td style="text-align:left;"><a href="/wiki/Bell_character" title="Bell character">Bell</a></td>
</tr>
<tr>
<td>000 1000</td>
<td style="background:lightblue;">010</td>
<td style="background:#CFF;">8</td>
<td style="background:lightblue;">08</td>
<td>FE0</td>
<td colspan="2">BS</td>
<td style="font-size:large;">␈</td>
<td><code><a href="/wiki/%5EH" class="mw-redirect" title="^H">^H</a></code></td>
<td><code><a href="/wiki/Backspace" title="Backspace">\b</a></code></td>
<td style="text-align:left;"><a href="/wiki/Backspace" title="Backspace">Backspace</a><sup id="cite_ref-42" class="reference"><a href="#cite_note-42">[e]</a></sup><sup id="cite_ref-bsp_del_mismatch_43-0" class="reference"><a href="#cite_note-bsp_del_mismatch-43">[f]</a></sup></td>
</tr>
<tr>
<td>000 1001</td>
<td style="background:lightblue;">011</td>
<td style="background:#CFF;">9</td>
<td style="background:lightblue;">09</td>
<td>HT/SK</td>
<td colspan="2">HT</td>
<td style="font-size:large;">␉</td>
<td><code><a href="/wiki/%5EI" class="mw-redirect" title="^I">^I</a></code></td>
<td><code><a href="/wiki/%5Ct" class="mw-redirect" title="\t">\t</a></code></td>
<td style="text-align:left;"><a href="/wiki/Horizontal_Tab" class="mw-redirect" title="Horizontal Tab">Horizontal Tab</a><sup id="cite_ref-44" class="reference"><a href="#cite_note-44">[g]</a></sup></td>
</tr>
<tr>
<td>000 1010</td>
<td style="background:lightblue;">012</td>
<td style="background:#CFF;">10</td>
<td style="background:lightblue;">0A</td>
<td colspan="3">LF</td>
<td style="font-size:large;">␊</td>
<td><code><a href="/wiki/%5EJ" class="mw-redirect" title="^J">^J</a></code></td>
<td><code><a href="/wiki/%5Cn" class="mw-redirect" title="\n">\n</a></code></td>
<td style="text-align:left;"><a href="/wiki/Line_Feed" class="mw-redirect" title="Line Feed">Line Feed</a></td>
</tr>
<tr>
<td>000 1011</td>
<td style="background:lightblue;">013</td>
<td style="background:#CFF;">11</td>
<td style="background:lightblue;">0B</td>
<td>VTAB</td>
<td colspan="2">VT</td>
<td style="font-size:large;">␋</td>
<td><code><a href="/wiki/%5EK" class="mw-redirect" title="^K">^K</a></code></td>
<td><code><a href="/wiki/%5Cv" class="mw-redirect" title="\v">\v</a></code></td>
<td style="text-align:left;"><a href="/wiki/Vertical_Tab" class="mw-redirect" title="Vertical Tab">Vertical Tab</a></td>
</tr>
<tr>
<td>000 1100</td>
<td style="background:lightblue;">014</td>
<td style="background:#CFF;">12</td>
<td style="background:lightblue;">0C</td>
<td colspan="3">FF</td>
<td style="font-size:large;">␌</td>
<td><code><a href="/wiki/%5EL" class="mw-redirect" title="^L">^L</a></code></td>
<td><code><a href="/wiki/%5Cf" class="mw-redirect" title="\f">\f</a></code></td>
<td style="text-align:left;"><a href="/wiki/Form_Feed" class="mw-redirect" title="Form Feed">Form Feed</a></td>
</tr>
<tr>
<td>000 1101</td>
<td style="background:lightblue;">015</td>
<td style="background:#CFF;">13</td>
<td style="background:lightblue;">0D</td>
<td colspan="3">CR</td>
<td style="font-size:large;">␍</td>
<td><code><a href="/wiki/%5EM" class="mw-redirect" title="^M">^M</a></code></td>
<td><code><a href="/wiki/%5Cr" class="mw-redirect" title="\r">\r</a></code></td>
<td style="text-align:left;"><a href="/wiki/Carriage_Return" class="mw-redirect" title="Carriage Return">Carriage Return</a><sup id="cite_ref-45" class="reference"><a href="#cite_note-45">[h]</a></sup></td>
</tr>
<tr>
<td>000 1110</td>
<td style="background:lightblue;">016</td>
<td style="background:#CFF;">14</td>
<td style="background:lightblue;">0E</td>
<td colspan="3">SO</td>
<td style="font-size:large;">␎</td>
<td><code><a href="/wiki/%5EN" class="mw-redirect" title="^N">^N</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Shift_Out" class="mw-redirect" title="Shift Out">Shift Out</a></td>
</tr>
<tr>
<td>000 1111</td>
<td style="background:lightblue;">017</td>
<td style="background:#CFF;">15</td>
<td style="background:lightblue;">0F</td>
<td colspan="3">SI</td>
<td style="font-size:large;">␏</td>
<td><code><a href="/wiki/%5EO" class="mw-redirect" title="^O">^O</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Shift_In" class="mw-redirect" title="Shift In">Shift In</a></td>
</tr>
<tr>
<td>001 0000</td>
<td style="background:lightblue;">020</td>
<td style="background:#CFF;">16</td>
<td style="background:lightblue;">10</td>
<td>DC0</td>
<td colspan="2">DLE</td>
<td style="font-size:large;">␐</td>
<td><code><a href="/wiki/%5EP" class="mw-redirect" title="^P">^P</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Data_Link_Escape" class="mw-redirect" title="Data Link Escape">Data Link Escape</a></td>
</tr>
<tr>
<td>001 0001</td>
<td style="background:lightblue;">021</td>
<td style="background:#CFF;">17</td>
<td style="background:lightblue;">11</td>
<td colspan="3">DC1</td>
<td style="font-size:large;">␑</td>
<td><code><a href="/wiki/%5EQ" class="mw-redirect" title="^Q">^Q</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Device_Control_1" class="mw-redirect" title="Device Control 1">Device Control 1</a> (often <a href="/wiki/XON" class="mw-redirect" title="XON">XON</a>)</td>
</tr>
<tr>
<td>001 0010</td>
<td style="background:lightblue;">022</td>
<td style="background:#CFF;">18</td>
<td style="background:lightblue;">12</td>
<td colspan="3">DC2</td>
<td style="font-size:large;">␒</td>
<td><code><a href="/wiki/%5ER" class="mw-redirect" title="^R">^R</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Device_Control_2" class="mw-redirect" title="Device Control 2">Device Control 2</a></td>
</tr>
<tr>
<td>001 0011</td>
<td style="background:lightblue;">023</td>
<td style="background:#CFF;">19</td>
<td style="background:lightblue;">13</td>
<td colspan="3">DC3</td>
<td style="font-size:large;">␓</td>
<td><code><a href="/wiki/%5ES" class="mw-redirect" title="^S">^S</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Device_Control_3" class="mw-redirect" title="Device Control 3">Device Control 3</a> (often <a href="/wiki/XOFF" class="mw-redirect" title="XOFF">XOFF</a>)</td>
</tr>
<tr>
<td>001 0100</td>
<td style="background:lightblue;">024</td>
<td style="background:#CFF;">20</td>
<td style="background:lightblue;">14</td>
<td colspan="3">DC4</td>
<td style="font-size:large;">␔</td>
<td><code><a href="/wiki/%5ET" class="mw-redirect" title="^T">^T</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Device_Control_4" class="mw-redirect" title="Device Control 4">Device Control 4</a></td>
</tr>
<tr>
<td>001 0101</td>
<td style="background:lightblue;">025</td>
<td style="background:#CFF;">21</td>
<td style="background:lightblue;">15</td>
<td>ERR</td>
<td colspan="2">NAK</td>
<td style="font-size:large;">␕</td>
<td><code><a href="/wiki/%5EU" class="mw-redirect" title="^U">^U</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Negative-acknowledge_character" class="mw-redirect" title="Negative-acknowledge character">Negative Acknowledgement</a></td>
</tr>
<tr>
<td>001 0110</td>
<td style="background:lightblue;">026</td>
<td style="background:#CFF;">22</td>
<td style="background:lightblue;">16</td>
<td>SYNC</td>
<td colspan="2">SYN</td>
<td style="font-size:large;">␖</td>
<td><code><a href="/wiki/%5EV" class="mw-redirect" title="^V">^V</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Synchronous_Idle" title="Synchronous Idle">Synchronous Idle</a></td>
</tr>
<tr>
<td>001 0111</td>
<td style="background:lightblue;">027</td>
<td style="background:#CFF;">23</td>
<td style="background:lightblue;">17</td>
<td>LEM</td>
<td colspan="2">ETB</td>
<td style="font-size:large;">␗</td>
<td><code><a href="/wiki/%5EW" class="mw-redirect" title="^W">^W</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/End-of-Transmission-Block_character" title="End-of-Transmission-Block character">End of Transmission Block</a></td>
</tr>
<tr>
<td>001 1000</td>
<td style="background:lightblue;">030</td>
<td style="background:#CFF;">24</td>
<td style="background:lightblue;">18</td>
<td>S0</td>
<td colspan="2">CAN</td>
<td style="font-size:large;">␘</td>
<td><code><a href="/wiki/%5EX" class="mw-redirect" title="^X">^X</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Cancel_character" title="Cancel character">Cancel</a></td>
</tr>
<tr>
<td>001 1001</td>
<td style="background:lightblue;">031</td>
<td style="background:#CFF;">25</td>
<td style="background:lightblue;">19</td>
<td>S1</td>
<td colspan="2">EM</td>
<td style="font-size:large;">␙</td>
<td><code><a href="/wiki/%5EY" class="mw-redirect" title="^Y">^Y</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/End_of_Medium" class="mw-redirect" title="End of Medium">End of Medium</a></td>
</tr>
<tr>
<td>001 1010</td>
<td style="background:lightblue;">032</td>
<td style="background:#CFF;">26</td>
<td style="background:lightblue;">1A</td>
<td>S2</td>
<td>SS</td>
<td>SUB</td>
<td style="font-size:large;">␚</td>
<td><code><a href="/wiki/%5EZ" class="mw-redirect" title="^Z">^Z</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Substitute_character" title="Substitute character">Substitute</a></td>
</tr>
<tr>
<td>001 1011</td>
<td style="background:lightblue;">033</td>
<td style="background:#CFF;">27</td>
<td style="background:lightblue;">1B</td>
<td>S3</td>
<td colspan="2">ESC</td>
<td style="font-size:large;">␛</td>
<td><code>^[</code></td>
<td><code><a href="/wiki/%5Ce" class="mw-redirect" title="\e">\e</a></code><sup id="cite_ref-46" class="reference"><a href="#cite_note-46">[i]</a></sup></td>
<td style="text-align:left;"><a href="/wiki/Escape_character" title="Escape character">Escape</a><sup id="cite_ref-47" class="reference"><a href="#cite_note-47">[j]</a></sup></td>
</tr>
<tr>
<td>001 1100</td>
<td style="background:lightblue;">034</td>
<td style="background:#CFF;">28</td>
<td style="background:lightblue;">1C</td>
<td>S4</td>
<td colspan="2">FS</td>
<td style="font-size:large;">␜</td>
<td><code><a href="/wiki/%5E%5C" class="mw-redirect" title="^\">^\</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/File_Separator" class="mw-redirect" title="File Separator">File Separator</a></td>
</tr>
<tr>
<td>001 1101</td>
<td style="background:lightblue;">035</td>
<td style="background:#CFF;">29</td>
<td style="background:lightblue;">1D</td>
<td>S5</td>
<td colspan="2">GS</td>
<td style="font-size:large;">␝</td>
<td><code>^]</code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Group_Separator" class="mw-redirect" title="Group Separator">Group Separator</a></td>
</tr>
<tr>
<td>001 1110</td>
<td style="background:lightblue;">036</td>
<td style="background:#CFF;">30</td>
<td style="background:lightblue;">1E</td>
<td>S6</td>
<td colspan="2">RS</td>
<td style="font-size:large;">␞</td>
<td><code>^^</code><sup id="cite_ref-48" class="reference"><a href="#cite_note-48">[k]</a></sup></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Record_Separator" class="mw-redirect" title="Record Separator">Record Separator</a></td>
</tr>
<tr>
<td>001 1111</td>
<td style="background:lightblue;">037</td>
<td style="background:#CFF;">31</td>
<td style="background:lightblue;">1F</td>
<td>S7</td>
<td colspan="2">US</td>
<td style="font-size:large;">␟</td>
<td><code>^_</code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Unit_Separator" class="mw-redirect" title="Unit Separator">Unit Separator</a></td>
</tr>
<tr>
<td>111 1111</td>
<td style="background:lightblue;">177</td>
<td style="background:#CFF;">127</td>
<td style="background:lightblue;">7F</td>
<td colspan="3">DEL</td>
<td style="font-size:large;">␡</td>
<td><code><a href="/wiki/%5E%3F" class="mw-redirect" title="^?">^?</a></code></td>
<td></td>
<td style="text-align:left;"><a href="/wiki/Delete_character" title="Delete character">Delete</a><sup id="cite_ref-49" class="reference"><a href="#cite_note-49">[l]</a></sup><sup id="cite_ref-bsp_del_mismatch_43-1" class="reference"><a href="#cite_note-bsp_del_mismatch-43">[f]</a></sup></td>
</tr>
</tbody></table>

<h1>Table 3</h1>
<table border="1">
<tbody><tr align="center" valign="bottom" style="margin:auto">
<td width="1.2%"><b>族→</b></td>
<td width="5.3%"><b><a href="/wiki/%E9%B9%BC%E9%87%91%E5%B1%AC" class="mw-redirect" title="碱金属">1</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E9%B9%BC%E5%9C%9F%E9%87%91%E5%B1%AC" class="mw-redirect" title="碱土金属">2</a></b></td>
<td width="5.3%"><b><a href="/wiki/3%E6%97%8F%E5%85%83%E7%B4%A0" title="3族元素">3</a></b></td>
<td width="5.3%"><b><a href="/wiki/4%E6%97%8F%E5%85%83%E7%B4%A0" title="4族元素">4</a></b></td>
<td width="5.3%"><b><a href="/wiki/5%E6%97%8F%E5%85%83%E7%B4%A0" title="5族元素">5</a></b></td>
<td width="5.3%"><b><a href="/wiki/6%E6%97%8F%E5%85%83%E7%B4%A0" title="6族元素">6</a></b></td>
<td width="5.3%"><b><a href="/wiki/7%E6%97%8F%E5%85%83%E7%B4%A0" title="7族元素">7</a></b></td>
<td width="5.3%"><b><a href="/wiki/8%E6%97%8F%E5%85%83%E7%B4%A0" title="8族元素">8</a></b></td>
<td width="5.3%"><b><a href="/wiki/9%E6%97%8F%E5%85%83%E7%B4%A0" title="9族元素">9</a></b></td>
<td width="5.3%"><b><a href="/wiki/10%E6%97%8F%E5%85%83%E7%B4%A0" title="10族元素">10</a></b></td>
<td width="5.3%"><b><a href="/wiki/11%E6%97%8F%E5%85%83%E7%B4%A0" title="11族元素">11</a></b></td>
<td width="5.3%"><b><a href="/wiki/12%E6%97%8F%E5%85%83%E7%B4%A0" title="12族元素">12</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E7%A1%BC%E6%97%8F%E5%85%83%E7%B4%A0" title="硼族元素">13</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E7%A2%B3%E6%97%8F%E5%85%83%E7%B4%A0" title="碳族元素">14</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E6%B0%AE%E6%97%8F%E5%85%83%E7%B4%A0" title="氮族元素">15</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E6%B0%A7%E6%97%8F%E5%85%83%E7%B4%A0" title="氧族元素">16</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E9%B9%B5%E7%B4%A0" class="mw-redirect" title="卤素">17</a></b></td>
<td width="5.3%"><b><a href="/wiki/%E7%A8%80%E6%9C%89%E6%B0%94%E4%BD%93" title="稀有气体">18</a></b></td>
<td rowspan="3" width="1.6%"><b>电子层</b></td>
<td rowspan="3" width="1.6%"><b>0族电子数</b></td>
</tr>
<tr align="center">
<td colspan="19">
<hr></td>
</tr>
<tr align="center" valign="bottom">
<td><b>周期↓</b></td>
<td><b>I</b>A</td>
<td colspan="16"></td>
<td><b>VIII</b>A<br>
(0)</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC1%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第1周期元素">1</a></td>
<td bgcolor="#A0FFA0"><span style="color:green;"><b>1</b></span><br>
H<br>
<a href="/wiki/%E6%B0%AB" class="mw-redirect" title="氢">氢</a><br>
1.008</td>
<td valign="bottom"><b>II</b> A</td>
<td colspan="10"></td>
<td valign="bottom"><b>III</b> A</td>
<td valign="bottom"><b>IV</b> A</td>
<td valign="bottom"><b>V</b> A</td>
<td valign="bottom"><b>VI</b> A</td>
<td valign="bottom"><b>VII</b> A</td>
<td bgcolor="#C0FFFF"><span style="color:green;"><b>2</b></span><br>
He<br>
<a href="/wiki/%E6%B0%A6" title="氦">氦</a><br>
4.003</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
<br>
<br>
<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
<br>
<br>
<br>
2</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC2%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第2周期元素">2</a></td>
<td bgcolor="#FF6666"><b>3</b><br>
Li<br>
<a href="/wiki/%E9%8B%B0" class="mw-redirect" title="锂">锂</a><br>
6.941</td>
<td bgcolor="#FFDEAD"><b>4</b><br>
Be<br>
<a href="/wiki/%E9%88%B9" class="mw-redirect" title="铍">铍</a><br>
9.012</td>
<td colspan="10"></td>
<td bgcolor="#CCCC99"><b>5</b><br>
B<br>
<a href="/wiki/%E7%A1%BC" title="硼">硼</a><br>
10.81</td>
<td bgcolor="#A0FFA0"><b>6</b><br>
C<br>
<a href="/wiki/%E7%A2%B3" title="碳">碳</a><br>
12.01</td>
<td bgcolor="#A0FFA0"><span style="color:green;"><b>7</b></span><br>
N<br>
<a href="/wiki/%E6%B0%AE" title="氮">氮</a><br>
14.01</td>
<td bgcolor="#A0FFA0"><span style="color:green;"><b>8</b></span><br>
O<br>
<a href="/wiki/%E6%B0%A7" title="氧">氧</a><br>
16.00</td>
<td bgcolor="#FFFF99"><span style="color:green;"><b>9</b></span><br>
F<br>
<a href="/wiki/%E6%B0%9F" title="氟">氟</a><br>
19.00</td>
<td bgcolor="#C0FFFF"><span style="color:green;"><b>10</b></span><br>
Ne<br>
<a href="/wiki/%E6%B0%96" title="氖">氖</a><br>
20.18</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
<br>
<br>
L<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
<br>
<br>
8<br>
2</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC3%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第3周期元素">3</a></td>
<td bgcolor="#FF6666"><b>11</b><br>
Na<br>
<a href="/wiki/%E9%88%89" class="mw-redirect" title="钠">钠</a><br>
22.99</td>
<td bgcolor="#FFDEAD"><b>12</b><br>
Mg<br>
<a href="/wiki/%E9%8E%82" class="mw-redirect" title="镁">镁</a><br>
24.31</td>
<td valign="bottom"><b>III</b> B</td>
<td valign="bottom"><b>IV</b> B</td>
<td valign="bottom"><b>V</b> B</td>
<td valign="bottom"><b>VI</b> B</td>
<td valign="bottom"><b>VII</b> B</td>
<td valign="bottom" colspan="3"><b>VIII</b> B<br>
<span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <semantics>
    <mrow class="MJX-TeXAtom-ORD">
      <mstyle displaystyle="true" scriptlevel="0">
        <mrow class="MJX-TeXAtom-OP">
          <mover>
            <mrow>
              <mspace width="2em"></mspace>
              <mspace width="2em"></mspace>
              <mspace width="2em"></mspace>
            </mrow>
            <mo accent="false">⏞<!-- ⏞ --></mo>
          </mover>
        </mrow>
      </mstyle>
    </mrow>
    <annotation encoding="application/x-tex">{\displaystyle \overbrace {\qquad \qquad \qquad } }</annotation>
  </semantics>
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/220427fd36f89da1fe868ced1f293fd5a1a90267" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.171ex; margin-right: -0.02ex; width:13.955ex; height:1.843ex;" alt="\overbrace {\qquad \qquad \qquad } "></span></td>
<td valign="bottom"><b>I</b> B</td>
<td valign="bottom"><b>II</b> B</td>
<td bgcolor="#CCCCCC"><b>13</b><br>
Al<br>
<a href="/wiki/%E9%8B%81" class="mw-redirect" title="铝">铝</a><br>
26.98</td>
<td bgcolor="#CCCC99"><b>14</b><br>
Si<br>
<a href="/wiki/%E7%A1%85" title="硅">硅</a><br>
28.09</td>
<td bgcolor="#A0FFA0"><b>15</b><br>
P<br>
<a href="/wiki/%E7%A3%B7" title="磷">磷</a><br>
30.97</td>
<td bgcolor="#A0FFA0"><b>16</b><br>
S<br>
<a href="/wiki/%E7%A1%AB" title="硫">硫</a><br>
32.07</td>
<td bgcolor="#FFFF99"><span style="color:green;"><b>17</b></span><br>
Cl<br>
<a href="/wiki/%E6%B0%AF" title="氯">氯</a><br>
35.45</td>
<td bgcolor="#C0FFFF"><span style="color:green;"><b>18</b></span><br>
Ar<br>
<a href="/wiki/%E6%B0%AC" class="mw-redirect" title="氩">氩</a><br>
39.95</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
<br>
M<br>
L<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
<br>
8<br>
8<br>
2</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC4%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第4周期元素">4</a></td>
<td bgcolor="#FF6666"><b>19</b><br>
K<br>
<a href="/wiki/%E9%89%80" class="mw-redirect" title="钾">钾</a><br>
39.10</td>
<td bgcolor="#FFDEAD"><b>20</b><br>
Ca<br>
<a href="/wiki/%E9%88%A3" class="mw-redirect" title="钙">钙</a><br>
40.08</td>
<td bgcolor="#FFC0C0"><b>21</b><br>
Sc<br>
<a href="/wiki/%E9%88%A7" class="mw-redirect" title="钪">钪</a><br>
44.96</td>
<td bgcolor="#FFC0C0"><b>22</b><br>
Ti<br>
<a href="/wiki/%E9%88%A6" class="mw-redirect" title="钛">钛</a><br>
47.88</td>
<td bgcolor="#FFC0C0"><b>23</b><br>
V<br>
<a href="/wiki/%E9%87%A9" class="mw-redirect" title="钒">钒</a><br>
50.94</td>
<td bgcolor="#FFC0C0"><b>24</b><br>
Cr<br>
<a href="/wiki/%E9%89%BB" class="mw-redirect" title="铬">铬</a><br>
52.00</td>
<td bgcolor="#FFC0C0"><b>25</b><br>
Mn<br>
<a href="/wiki/%E9%8C%B3" class="mw-redirect" title="锰">锰</a><br>
54.94</td>
<td bgcolor="#FFC0C0"><b>26</b><br>
Fe<br>
<a href="/wiki/%E9%90%B5" class="mw-redirect" title="铁">铁</a><br>
55.85</td>
<td bgcolor="#FFC0C0"><b>27</b><br>
Co<br>
<a href="/wiki/%E9%88%B7" class="mw-redirect" title="钴">钴</a><br>
58.93</td>
<td bgcolor="#FFC0C0"><b>28</b><br>
Ni<br>
<a href="/wiki/%E9%8E%B3" class="mw-redirect" title="镍">镍</a><br>
58.69</td>
<td bgcolor="#FFC0C0"><b>29</b><br>
Cu<br>
<a href="/wiki/%E9%8A%85" class="mw-redirect" title="铜">铜</a><br>
63.55</td>
<td bgcolor="#FFC0C0"><b>30</b><br>
Zn<br>
<a href="/wiki/%E9%8B%85" class="mw-redirect" title="锌">锌</a><br>
65.39</td>
<td bgcolor="#CCCCCC"><b>31</b><br>
Ga<br>
<a href="/wiki/%E9%8E%B5" class="mw-redirect" title="镓">镓</a><br>
69.72</td>
<td bgcolor="#CCCC99"><b>32</b><br>
Ge<br>
<a href="/wiki/%E9%8D%BA" class="mw-redirect" title="锗">锗</a><br>
72.59</td>
<td bgcolor="#CCCC99"><b>33</b><br>
As<br>
<a href="/wiki/%E7%A0%B7" title="砷">砷</a><br>
74.92</td>
<td bgcolor="#A0FFA0"><b>34</b><br>
Se<br>
<a href="/wiki/%E7%A1%92" title="硒">硒</a><br>
78.96</td>
<td bgcolor="#FFFF99"><span style="color:blue;"><b>35</b></span><br>
Br<br>
<a href="/wiki/%E6%BA%B4" title="溴">溴</a><br>
79.90</td>
<td bgcolor="#C0FFFF"><span style="color:green;"><b>36</b></span><br>
Kr<br>
<a href="/wiki/%E6%B0%AA" title="氪">氪</a><br>
83.80</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
N<br>
M<br>
L<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
<br>
8<br>
18<br>
8<br>
2</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC5%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第5周期元素">5</a></td>
<td bgcolor="#FF6666"><b>37</b><br>
Rb<br>
<a href="/wiki/%E9%8A%A3" class="mw-redirect" title="铷">铷</a><br>
85.47</td>
<td bgcolor="#FFDEAD"><b>38</b><br>
Sr<br>
<a href="/wiki/%E9%8D%B6" class="mw-redirect" title="锶">锶</a><br>
87.62</td>
<td bgcolor="#FFC0C0"><b>39</b><br>
Y<br>
<a href="/wiki/%E9%87%94" class="mw-redirect" title="钇">钇</a><br>
88.91</td>
<td bgcolor="#FFC0C0"><b>40</b><br>
Zr<br>
<a href="/wiki/%E9%8B%AF" class="mw-redirect" title="锆">锆</a><br>
91.22</td>
<td bgcolor="#FFC0C0"><b>41</b><br>
Nb<br>
<a href="/wiki/%E9%88%AE" class="mw-redirect" title="铌">铌</a><br>
92.91</td>
<td bgcolor="#FFC0C0"><b>42</b><br>
Mo<br>
<a href="/wiki/%E9%89%AC" class="mw-redirect" title="钼">钼</a><br>
95.94</td>
<td bgcolor="#FFC0C0"><b>43</b><br>
Tc<br>
<a href="/wiki/%E9%8E%9D" class="mw-redirect" title="锝">锝</a><br>
(97.91)</td>
<td bgcolor="#FFC0C0"><b>44</b><br>
Ru<br>
<a href="/wiki/%E9%87%95" class="mw-redirect" title="钌">钌</a><br>
101.1</td>
<td bgcolor="#FFC0C0"><b>45</b><br>
Rh<br>
<a href="/wiki/%E9%8A%A0" class="mw-redirect" title="铑">铑</a><br>
102.9</td>
<td bgcolor="#FFC0C0"><b>46</b><br>
Pd<br>
<a href="/wiki/%E9%88%80" class="mw-redirect" title="钯">钯</a><br>
106.4</td>
<td bgcolor="#FFC0C0"><b>47</b><br>
Ag<br>
<a href="/wiki/%E9%8A%80" title="银">银</a><br>
107.9</td>
<td bgcolor="#FFC0C0"><b>48</b><br>
Cd<br>
<a href="/wiki/%E9%8E%98" class="mw-redirect" title="镉">镉</a><br>
112.4</td>
<td bgcolor="#CCCCCC"><b>49</b><br>
In<br>
<a href="/wiki/%E9%8A%A6" class="mw-redirect" title="铟">铟</a><br>
114.8</td>
<td bgcolor="#CCCCCC"><b>50</b><br>
Sn<br>
<a href="/wiki/%E9%8C%AB" class="mw-redirect" title="锡">锡</a><br>
118.7</td>
<td bgcolor="#CCCC99"><b>51</b><br>
Sb<br>
<a href="/wiki/%E9%8A%BB" class="mw-redirect" title="锑">锑</a><br>
121.8</td>
<td bgcolor="#CCCC99"><b>52</b><br>
Te<br>
<a href="/wiki/%E7%A2%B2" title="碲">碲</a><br>
127.6</td>
<td bgcolor="#FFFF99"><b>53</b><br>
I<br>
<a href="/wiki/%E7%A2%98" title="碘">碘</a><br>
126.9</td>
<td bgcolor="#C0FFFF"><span style="color:green;"><b>54</b></span><br>
Xe<br>
<a href="/wiki/%E6%B0%99" title="氙">氙</a><br>
131.3</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
O<br>
N<br>
M<br>
L<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2"><br>
8<br>
18<br>
18<br>
8<br>
2</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC6%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第6周期元素">6</a></td>
<td bgcolor="#FF6666"><b>55</b><br>
Cs<br>
<a href="/wiki/%E9%8A%AB" class="mw-redirect" title="铯">铯</a><br>
132.9</td>
<td bgcolor="#FFDEAD"><b>56</b><br>
Ba<br>
<a href="/wiki/%E9%8B%87" class="mw-redirect" title="钡">钡</a><br>
137.3</td>
<td bgcolor="#FFBFFF"><b>57</b>-<br>
<b>71</b><br>
<a href="/wiki/%E9%91%AD%E7%B3%BB%E5%85%83%E7%B4%A0" class="mw-redirect" title="镧系元素">镧系<br>
元素</a></td>
<td bgcolor="#FFC0C0"><b>72</b><br>
Hf<br>
<a href="/wiki/%E9%89%BF" class="mw-redirect" title="铪">铪</a><br>
178.5</td>
<td bgcolor="#FFC0C0"><b>73</b><br>
Ta<br>
<a href="/wiki/%E9%89%AD" class="mw-redirect" title="钽">钽</a><br>
180.9</td>
<td bgcolor="#FFC0C0"><b>74</b><br>
W<br>
<a href="/wiki/%E9%8E%A2" class="mw-redirect" title="钨">钨</a><br>
183.9</td>
<td bgcolor="#FFC0C0"><b>75</b><br>
Re<br>
<a href="/wiki/%E9%8C%B8" class="mw-redirect" title="铼">铼</a><br>
186.2</td>
<td bgcolor="#FFC0C0"><b>76</b><br>
Os<br>
<a href="/wiki/%E9%8B%A8" class="mw-redirect" title="锇">锇</a><br>
190.2</td>
<td bgcolor="#FFC0C0"><b>77</b><br>
Ir<br>
<a href="/wiki/%E9%8A%A5" class="mw-redirect" title="铱">铱</a><br>
192.2</td>
<td bgcolor="#FFC0C0"><b>78</b><br>
Pt<br>
<a href="/wiki/%E9%89%91" class="mw-redirect" title="铂">铂</a><br>
195.1</td>
<td bgcolor="#FFC0C0"><b>79</b><br>
Au<br>
<a href="/wiki/%E9%87%91" title="金">金</a><br>
197.0</td>
<td bgcolor="#FFC0C0"><span style="color:blue;"><b>80</b></span><br>
Hg<br>
<a href="/wiki/%E6%B1%9E" title="汞">汞</a><br>
200.6</td>
<td bgcolor="#CCCCCC"><b>81</b><br>
Tl<br>
<a href="/wiki/%E9%89%88" class="mw-redirect" title="铊">铊</a><br>
204.4</td>
<td bgcolor="#CCCCCC"><b>82</b><br>
Pb<br>
<a href="/wiki/%E9%89%9B" class="mw-redirect" title="铅">铅</a><br>
207.2</td>
<td bgcolor="#CCCCCC"><b>83</b><br>
Bi<br>
<a href="/wiki/%E9%89%8D" class="mw-redirect" title="铋">铋</a><br>
209.0</td>
<td bgcolor="#CCCCCC"><b>84</b><br>
Po<br>
<a href="/wiki/%E9%87%99" class="mw-redirect" title="钋">钋</a><br>
(209.0)</td>
<td bgcolor="#FFFF99"><b>85</b><br>
At<br>
<a href="/wiki/%E7%A0%B9" title="砹">砹</a><br>
(210.0)</td>
<td bgcolor="#C0FFFF"><span style="color:green;"><b>86</b></span><br>
Rn<br>
<a href="/wiki/%E6%B0%A1" title="氡">氡</a><br>
(222.0)</td>
<td valign="bottom" style="font-size:50%;line-height:1.2">P<br>
O<br>
N<br>
M<br>
L<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2">8<br>
18<br>
32<br>
18<br>
8<br>
2</td>
</tr>
<tr align="center">
<td><a href="/wiki/%E7%AC%AC7%E5%91%A8%E6%9C%9F%E5%85%83%E7%B4%A0" title="第7周期元素">7</a></td>
<td bgcolor="#FF6666"><b>87</b><br>
Fr<br>
<a href="/wiki/%E9%8D%85" class="mw-redirect" title="钫">钫</a><br>
(223.0)</td>
<td bgcolor="#FFDEAD"><b>88</b><br>
Ra<br>
<a href="/wiki/%E9%90%B3" class="mw-redirect" title="镭">镭</a><br>
(226.0)</td>
<td bgcolor="#FF99CC"><b>89</b>-<br>
<b>103</b><br>
<a href="/wiki/%E9%8C%92%E7%B3%BB%E5%85%83%E7%B4%A0" class="mw-redirect" title="锕系元素">锕系<br>
元素</a></td>
<td bgcolor="#FFC0C0"><span style="color:grey;"><b>104</b></span><br>
Rf<br>
<a href="/wiki/%E9%91%AA" title="𬬻">𬬻(鑪)</a><br>
(265.1)</td>
<td bgcolor="#FFC0C0"><span style="color:grey;"><b>105</b></span><br>
Db<br>
<a href="/wiki/%F0%A8%A7%80" title="𨧀">𬭊(𨧀)</a><br>
(268.1)</td>
<td bgcolor="#FFC0C0"><span style="color:grey;"><b>106</b></span><br>
Sg<br>
<a href="/wiki/%F0%A8%AD%8E" title="𨭎">𬭳(𨭎)</a><br>
(271.1)</td>
<td bgcolor="#FFC0C0"><span style="color:grey;"><b>107</b></span><br>
Bh<br>
<a href="/wiki/%F0%A8%A8%8F" title="𨨏">𬭛(𨨏)</a><br>
(270.1)</td>
<td bgcolor="#FFC0C0"><span style="color:grey;"><b>108</b></span><br>
Hs<br>
<a href="/wiki/%F0%A8%AD%86" title="𬭶">𬭶(𨭆)</a><br>
(277.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>109</b></span><br>
Mt<br>
<a href="/wiki/%E4%A5%91" title="鿏">鿏(䥑)</a><br>
(276.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>110</b></span><br>
Ds<br>
<a href="/wiki/%E9%90%BD" title="𫟼">𫟼(鐽)</a><br>
(281.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>111</b></span><br>
Rg<br>
<a href="/wiki/%E9%8C%80" title="錀">𬬭(錀)</a><br>
(280.2)</td>
<td bgcolor="#FFC0C0"><span style="color:grey;"><b>112</b></span><br>
Cn<br>
<a href="/wiki/%E9%8E%B6" title="鿔">鿔(鎶)</a><br>
(285.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>113</b></span><br>
Nh<br>
<a href="/wiki/Nh" title="读音:ni3,字符描述:左「钅」右「尔」"><img alt="缺字图片" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Nihonium_zh-hans.svg/15px-Nihonium_zh-hans.svg.png" width="15" height="15" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Nihonium_zh-hans.svg/23px-Nihonium_zh-hans.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Nihonium_zh-hans.svg/30px-Nihonium_zh-hans.svg.png 2x" data-file-width="200" data-file-height="200"></a><br>
(284.2)</td>
<td bgcolor="#CCCCCC"><span style="color:grey;"><b>114</b></span><br>
Fl<br>
<a href="/wiki/%E9%88%87" title="𫓧">𫓧(鈇)</a><br>
(289.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>115</b></span><br>
Mc<br>
<a href="/wiki/%E9%8F%8C" class="mw-redirect" title="镆">镆</a><br>
(288.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>116</b></span><br>
Lv<br>
<a href="/wiki/%E9%89%9D" title="𫟷">𫟷(鉝)</a><br>
(293.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>117</b></span><br>
Ts<br>
<a href="/wiki/Ts" title="读音:tian2,字符描述:左「石」右「田」"><img alt="缺字图片" src="//upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Tennessine_zh.svg/15px-Tennessine_zh.svg.png" width="15" height="15" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Tennessine_zh.svg/23px-Tennessine_zh.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Tennessine_zh.svg/30px-Tennessine_zh.svg.png 2x" data-file-width="200" data-file-height="200"></a><br>
(294.2)</td>
<td bgcolor="#E8E8E8"><span style="color:grey;"><b>118</b></span><br>
Og<br>
<a href="/wiki/Og" title="读音:ao4,字符描述:⿹气奥"><img alt="缺字图片" src="//upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Oganesson_zh-hans.svg/15px-Oganesson_zh-hans.svg.png" width="15" height="15" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Oganesson_zh-hans.svg/23px-Oganesson_zh-hans.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Oganesson_zh-hans.svg/30px-Oganesson_zh-hans.svg.png 2x" data-file-width="200" data-file-height="200"></a><br>
(294.2)</td>
<td valign="bottom" style="font-size:50%;line-height:1.2">Q<br>
P<br>
O<br>
N<br>
M<br>
L<br>
K</td>
<td valign="bottom" style="font-size:50%;line-height:1.2">8<br>
18<br>
32<br>
32<br>
18<br>
8<br>
2</td>
</tr>

<tr align="center">
<td colspan="3" align="right"><a href="/wiki/%E9%91%AD%E7%B3%BB%E5%85%83%E7%B4%A0" class="mw-redirect" title="镧系元素">镧系元素</a></td>
<td bgcolor="#FFBFFF"><b>57</b><br>
La<br>
<a href="/wiki/%E9%91%AD" class="mw-redirect" title="镧">镧</a><br>
138.9</td>
<td bgcolor="#FFBFFF"><b>58</b><br>
Ce<br>
<a href="/wiki/%E9%88%B0" class="mw-redirect" title="铈">铈</a><br>
140.1</td>
<td bgcolor="#FFBFFF"><b>59</b><br>
Pr<br>
<a href="/wiki/%E9%90%A0" class="mw-redirect" title="镨">镨</a><br>
140.9</td>
<td bgcolor="#FFBFFF"><b>60</b><br>
Nd<br>
<a href="/wiki/%E9%87%B9" class="mw-redirect" title="钕">钕</a><br>
144.2</td>
<td bgcolor="#FFBFFF"><b>61</b><br>
Pm<br>
<a href="/wiki/%E9%89%95" class="mw-redirect" title="钷">钷</a><br>
(144.9)</td>
<td bgcolor="#FFBFFF"><b>62</b><br>
Sm<br>
<a href="/wiki/%E9%87%A4" class="mw-redirect" title="钐">钐</a><br>
150.4</td>
<td bgcolor="#FFBFFF"><b>63</b><br>
Eu<br>
<a href="/wiki/%E9%8A%AA" class="mw-redirect" title="铕">铕</a><br>
152.0</td>
<td bgcolor="#FFBFFF"><b>64</b><br>
Gd<br>
<a href="/wiki/%E9%87%93" class="mw-redirect" title="钆">钆</a><br>
157.3</td>
<td bgcolor="#FFBFFF"><b>65</b><br>
Tb<br>
<a href="/wiki/%E9%8B%B1" class="mw-redirect" title="铽">铽</a><br>
158.9</td>
<td bgcolor="#FFBFFF"><b>66</b><br>
Dy<br>
<a href="/wiki/%E9%8F%91" class="mw-redirect" title="镝">镝</a><br>
162.5</td>
<td bgcolor="#FFBFFF"><b>67</b><br>
Ho<br>
<a href="/wiki/%E9%88%A5" class="mw-redirect" title="钬">钬</a><br>
164.9</td>
<td bgcolor="#FFBFFF"><b>68</b><br>
Er<br>
<a href="/wiki/%E9%89%BA" class="mw-redirect" title="铒">铒</a><br>
167.3</td>
<td bgcolor="#FFBFFF"><b>69</b><br>
Tm<br>
<a href="/wiki/%E9%8A%A9" class="mw-redirect" title="铥">铥</a><br>
168.9</td>
<td bgcolor="#FFBFFF"><b>70</b><br>
Yb<br>
<a href="/wiki/%E9%90%BF" class="mw-redirect" title="镱">镱</a><br>
173.0</td>
<td bgcolor="#FFBFFF"><b>71</b><br>
Lu<br>
<a href="/wiki/%E9%8E%A6" class="mw-redirect" title="镥">镥</a><br>
175.0</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr align="center">
<td colspan="3" align="right"><a href="/wiki/%E9%8C%92%E7%B3%BB%E5%85%83%E7%B4%A0" class="mw-redirect" title="锕系元素">锕系元素</a></td>
<td bgcolor="#FF99CC"><b>89</b><br>
Ac<br>
<a href="/wiki/%E9%8C%92" class="mw-redirect" title="锕">锕</a><br>
(227.0)</td>
<td bgcolor="#FF99CC"><b>90</b><br>
Th<br>
<a href="/wiki/%E9%87%B7" class="mw-redirect" title="钍">钍</a><br>
232.0</td>
<td bgcolor="#FF99CC"><b>91</b><br>
Pa<br>
<a href="/wiki/%E9%8F%B7" class="mw-redirect" title="镤">镤</a><br>
231.0</td>
<td bgcolor="#FF99CC"><b>92</b><br>
U<br>
<a href="/wiki/%E9%88%BE" title="铀">铀</a><br>
238.0</td>
<td bgcolor="#FF99CC"><b>93</b><br>
Np<br>
<a href="/wiki/%E9%8C%BC" class="mw-redirect" title="镎">镎</a><br>
(237.1)</td>
<td bgcolor="#FF99CC"><b>94</b><br>
Pu<br>
<a href="/wiki/%E9%88%BD" class="mw-redirect" title="钚">钚</a><br>
(244.1)</td>
<td bgcolor="#FF99CC"><b>95</b><br>
Am<br>
<a href="/wiki/%E9%8B%82" class="mw-redirect" title="镅">镅</a><br>
(243.1)</td>
<td bgcolor="#FF99CC"><b>96</b><br>
Cm<br>
<a href="/wiki/%E9%8B%A6" class="mw-redirect" title="锔">锔</a><br>
(247.1)</td>
<td bgcolor="#FF99CC"><b>97</b><br>
Bk<br>
<a href="/wiki/%E9%89%B3" class="mw-redirect" title="锫">锫</a><br>
(247.1)</td>
<td bgcolor="#FF99CC"><b>98</b><br>
Cf<br>
<a href="/wiki/%E9%89%B2" class="mw-redirect" title="锎">锎</a><br>
(252.1)</td>
<td bgcolor="#FF99CC"><b>99</b><br>
Es<br>
<a href="/wiki/%E9%91%80" class="mw-redirect" title="锿">锿</a><br>
(252.1)</td>
<td bgcolor="#FF99CC"><span style="color:gray"><b>100</b></span><br>
Fm<br>
<a href="/wiki/%E9%90%A8" class="mw-redirect" title="镄">镄</a><br>
(257.1)</td>
<td bgcolor="#FF99CC"><span style="color:gray"><b>101</b></span><br>
Md<br>
<a href="/wiki/%E9%8D%86" class="mw-redirect" title="钔">钔</a><br>
(258.1)</td>
<td bgcolor="#FF99CC"><span style="color:gray"><b>102</b></span><br>
No<br>
<a href="/wiki/%E9%8D%A9" class="mw-redirect" title="锘">锘</a><br>
(259.1)</td>
<td bgcolor="#FF99CC"><span style="color:gray"><b>103</b></span><br>
Lr<br>
<a href="/wiki/%E9%90%92" title="铹">铹</a><br>
(262.1)</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>




</body></html>


================================================
FILE: docs/js/table2excel.core.js
================================================
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ExcelJS")):"function"==typeof define&&define.amd?define(["ExcelJS"],t):"object"==typeof exports?exports.Table2Excel=t(require("ExcelJS")):e.Table2Excel=t(e.ExcelJS)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argb=t.mergeCells=t.cellPosition=t.columnIndex=t.saveAsExcel=void 0;var r=n(1),o=n(6),l=(t.saveAsExcel=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"xlsx",l=r.MIME_TYPES[n];l?e.xlsx.writeBuffer().then(function(e){(0,o.saveAs)(new Blob([e.buffer],{type:l}),t+"."+n)}):console.error(n+" file extension is not supported")},function(e){var t="A".charCodeAt(0);return String.fromCharCode(t+e-1)}),i=t.columnIndex=function(e){var t=void 0;if((e+=1)<=26)t=l(e);else{var n=e%26,r=Math.floor(e/26);t=0===n?l(r-1)+l(26):l(r)+l(n)}return t},a=t.cellPosition=function(e,t){return""+i(e)+(t+1)};t.mergeCells=function(e,t,n,r,o){var l=a(t,n),i=a(r,o);return e.mergeCells(l,i),e.getCell(l)},t.argb=function(e){var t=e.split("(")[1].split(")")[0].split(",").map(function(e,t){return 3===t?255*e:e});return 3===t.length&&t.push(255),t.unshift(t.pop()),t.map(function(e){var t=parseInt(e).toString(16);return 1===t.length?"0"+t:t}).join("").toUpperCase()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MIME_TYPES={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},t.WIDTH_RATIO=.14},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(9)),o=c(n(10)),l=c(n(11)),i=c(n(12)),a=c(n(13)),u=c(n(14));function c(e){return e&&e.__esModule?e:{default:e}}t.default={fontPlugin:r.default,fillPlugin:o.default,formPlugin:l.default,alignmentPlugin:i.default,hyperlinkPlugin:a.default,autoWidthPlugin:u.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(4)),o=i(n(2)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0));function i(e){return e&&e.__esModule?e:{default:e}}r.default.plugins=o.default,r.default.utils=l,t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(5)),l=n(0),i=n(1),a=u(n(2));function u(e){return e&&e.__esModule?e:{default:e}}var c=["workbookCreated","worksheetCreated","worksheetCompleted","workcellCreated"],f={workbook:{views:[{x:0,y:0,width:1e4,height:2e4,firstSheet:0,activeTab:1,visibility:"visible"}]},widthRatio:i.WIDTH_RATIO,plugins:[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Object.values(a.default)))},s=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"table",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tables=Array.from("string"==typeof n?document.querySelectorAll(n):n),this.options=Object.assign({},f,r),this.plugins={},c.forEach(function(e){t.plugins[e]=t.options.plugins.filter(function(t){return t[e]}).map(function(t){return t[e]})}),this.pluginContext={}}return r(e,[{key:"_invokePlugin",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.pluginContext=Object.assign({},this.pluginContext,n),this.plugins[e].forEach(function(e){return e.call(t,t.pluginContext)})}},{key:"toExcel",value:function(){var e=this,t=this.tables,n=this.options,r=new o.default.Workbook;return Object.assign(r,n),this._invokePlugin("workbookCreated",{workbook:r,tables:t}),t.forEach(function(t,n){var o=r.addWorksheet("Sheet "+(n+1));e._invokePlugin("worksheetCreated",{worksheet:o,table:t}),e.toSheet(t,o),e._invokePlugin("worksheetCompleted",{worksheet:o,table:t})}),this.workbook=r}},{key:"toSheet",value:function(e,t){var n=this,r=e.rows.length,o=0;if(e.rows.length>0)for(var i=0;i<e.rows[0].cells.length;i++)o+=e.rows[0].cells[i].colSpan;var a=[];Array.from(e.rows).forEach(function(e){Array.from(e.cells).forEach(function(e){a.push({rowRange:{},colRange:{},el:e})})});for(var u=[],c=0;c<r;c++){for(var f=[],s=0;s<o;s++)f.push({cell:null});u.push(f)}for(var d=0,p=0;p<r;p++)for(var v=0;v<o;v++)if(!u[p][v].cell){var h=a[d++],g=h.el,b=g.rowSpan,w=g.colSpan;h.rowRange={from:p,to:p},h.colRange={from:v,to:v};for(var y=p;y<p+b;y++)for(var m=v;m<v+w;m++)u[y][m].cell=h,h.colRange.to=m,h.rowRange.to=y}a.forEach(function(e){var r=e.rowRange,o=e.colRange,i=e.el,a=i.innerText,u=(0,l.mergeCells)(t,o.from,r.from,o.to,r.to),c=getComputedStyle(i);u.value=a,n._invokePlugin("workcellCreated",{workcell:u,cell:i,rowRange:r,colRange:o,cellStyle:c})})}},{key:"export",value:function(e,t){this.workbook||this.toExcel(),(0,l.saveAsExcel)(this.workbook,e,t)}}]),e}();t.default=s},function(t,n){t.exports=e},function(e,t,n){var r,o=o||function(e){"use strict";if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=function(){return e.URL||e.webkitURL||e},n=e.document.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in n,o=/constructor/i.test(e.HTMLElement)||e.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent),i=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},a=function(e){setTimeout(function(){"string"==typeof e?t().revokeObjectURL(e):e.remove()},4e4)},u=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},c=function(c,f,s){s||(c=u(c));var d,p=this,v="application/octet-stream"===c.type,h=function(){!function(e,t,n){for(var r=(t=[].concat(t)).length;r--;){var o=e["on"+t[r]];if("function"==typeof o)try{o.call(e,n||e)}catch(e){i(e)}}}(p,"writestart progress write writeend".split(" "))};if(p.readyState=p.INIT,r)return d=t().createObjectURL(c),void setTimeout(function(){n.href=d,n.download=f,function(e){var t=new MouseEvent("click");e.dispatchEvent(t)}(n),h(),a(d),p.readyState=p.DONE});!function(){if((l||v&&o)&&e.FileReader){var n=new FileReader;return n.onloadend=function(){var t=l?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,p.readyState=p.DONE,h()},n.readAsDataURL(c),void(p.readyState=p.INIT)}d||(d=t().createObjectURL(c)),v?e.location.href=d:e.open(d,"_blank")||(e.location.href=d);p.readyState=p.DONE,h(),a(d)}()},f=c.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return t=t||e.name||"download",n||(e=u(e)),navigator.msSaveOrOpenBlob(e,t)}:(f.abort=function(){},f.readyState=f.INIT=0,f.WRITING=1,f.DONE=2,f.error=f.onwritestart=f.onprogress=f.onwrite=f.onabort=f.onerror=f.onwriteend=null,function(e,t,n){return new c(e,t||e.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */void 0!==e&&e.exports?e.exports.saveAs=o:null!==n(7)&&null!==n(8)&&(void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r))},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(0);t.default={workcellCreated:function(e){var t=e.workcell,n=e.cellStyle,l=n.fontWeight;t.font=r({},t.font||{},{name:n.fontFamily,color:{argb:(0,o.argb)(n.color)},bold:"bold"===l||+l>600})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(0);t.default={workcellCreated:function(e){var t=e.workcell,n=e.cellStyle,l=(0,o.argb)(n.backgroundColor);t.fill=r({},t.fill||{},"00000000"===l?{type:"pattern",pattern:"none"}:{type:"pattern",pattern:"solid",fgColor:{argb:l}})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={workcellCreated:function(e){var t=e.workcell,n=e.cell.children[0];n&&["INPUT","SELECT","TEXTAREA"].includes(n.tagName)&&(t.value=n.value)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default={workcellCreated:function(e){var t=e.workcell,n=e.cellStyle,o=n.verticalAlign,l=n.textAlign;t.alignment=r({},t.alignment||{},{vertical:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=["top","middle","bottom"],n=0;n<t.length;n++)if(e.includes(t[n]))return t[n];return{baseline:"middle",super:"top",sub:"bottom"}[e]}(o),horizontal:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=["right","left","center","justify"],n=0;n<t.length;n++)if(e.includes(t[n]))return t[n]}(l)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={workcellCreated:function(e){var t=e.workcell,n=e.cell.children[0];n&&"A"===n.tagName&&(t.value={text:n.innerText,hyperlink:n.href})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={workcellCreated:function(e){var t=e.worksheet,n=e.colRange,r=(e.cell,e.cellStyle);n.from===n.to&&"auto"!==r.width&&(t.getColumn(n.from+1).width=+r.width.split("px")[0]*this.options.widthRatio)}}}]).default});

================================================
FILE: es5/constants.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
var MIME_TYPES = exports.MIME_TYPES = {
  xls: 'application/vnd.ms-excel',
  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
};

var WIDTH_RATIO = exports.WIDTH_RATIO = .14;

================================================
FILE: es5/index.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _table2excel = require('./table2excel');

var _table2excel2 = _interopRequireDefault(_table2excel);

var _plugins = require('./plugins');

var _plugins2 = _interopRequireDefault(_plugins);

var _utils = require('./utils');

var utils = _interopRequireWildcard(_utils);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

_table2excel2.default.plugins = _plugins2.default;
_table2excel2.default.utils = utils;

exports.default = _table2excel2.default;

================================================
FILE: es5/plugins/alignment.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

/**
 * '-webkit-right' -> 'right'
 * 'right' -> 'right'
 *  etc...
 */
var getHorizontalAlign = function getHorizontalAlign() {
  var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

  var aligns = ['right', 'left', 'center', 'justify'];
  for (var i = 0; i < aligns.length; i++) {
    if (value.includes(aligns[i])) {
      return aligns[i];
    }
  }
};

/**
 * 'baseline' -> 'middle'
 * 'text-top' -> 'top'
 * 'text-bottom' -> 'bottom'
 * 'sub' -> 'top'
 * 'super' -> 'bottom'
 */
var getVerticalAlign = function getVerticalAlign() {
  var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

  var aligns = ['top', 'middle', 'bottom'];
  for (var i = 0; i < aligns.length; i++) {
    if (value.includes(aligns[i])) {
      return aligns[i];
    }
  }

  var mapping = {
    'baseline': 'middle',
    'super': 'top',
    'sub': 'bottom'
  };
  return mapping[value];
};

exports.default = {
  workcellCreated: function workcellCreated(_ref) {
    var workcell = _ref.workcell,
        cellStyle = _ref.cellStyle;
    var verticalAlign = cellStyle.verticalAlign,
        textAlign = cellStyle.textAlign;

    workcell.alignment = _extends({}, workcell.alignment || {}, {
      vertical: getVerticalAlign(verticalAlign),
      horizontal: getHorizontalAlign(textAlign)
    });
  }
};

================================================
FILE: es5/plugins/autoWidth.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = {
  workcellCreated: function workcellCreated(_ref) {
    var worksheet = _ref.worksheet,
        colRange = _ref.colRange,
        cell = _ref.cell,
        cellStyle = _ref.cellStyle;

    if (colRange.from === colRange.to && cellStyle.width !== 'auto') {
      worksheet.getColumn(colRange.from + 1).width = +cellStyle.width.split('px')[0] * this.options.widthRatio;
    }
  }
};

================================================
FILE: es5/plugins/fill.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _utils = require('../utils');

exports.default = {
  workcellCreated: function workcellCreated(_ref) {
    var workcell = _ref.workcell,
        cellStyle = _ref.cellStyle;

    var color = (0, _utils.argb)(cellStyle.backgroundColor);

    if (color === '00000000') {
      // background is transparent, equals none pattern fill
      workcell.fill = _extends({}, workcell.fill || {}, {
        type: 'pattern',
        pattern: 'none'
      });
    } else {
      workcell.fill = _extends({}, workcell.fill || {}, {
        type: 'pattern',
        pattern: 'solid',
        fgColor: { argb: color }
      });
    }
  }
};

================================================
FILE: es5/plugins/font.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _utils = require('../utils');

exports.default = {
  workcellCreated: function workcellCreated(_ref) {
    var workcell = _ref.workcell,
        cellStyle = _ref.cellStyle;

    var fontWeight = cellStyle.fontWeight;

    workcell.font = _extends({}, workcell.font || {}, {
      name: cellStyle.fontFamily,
      color: { argb: (0, _utils.argb)(cellStyle.color) },
      bold: fontWeight === 'bold' || +fontWeight > 600 ? true : false
    });
  }
};

================================================
FILE: es5/plugins/form.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = {
  workcellCreated: function workcellCreated(_ref) {
    var workcell = _ref.workcell,
        cell = _ref.cell;

    var child = cell.children[0];
    if (child && ['INPUT', 'SELECT', 'TEXTAREA'].includes(child.tagName)) {
      workcell.value = child.value;
    }
  }
};

================================================
FILE: es5/plugins/hyperlink.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = {
  workcellCreated: function workcellCreated(_ref) {
    var workcell = _ref.workcell,
        cell = _ref.cell;

    var child = cell.children[0];
    if (child && child.tagName === 'A') {
      workcell.value = { text: child.innerText, hyperlink: child.href };
    }
  }
};

================================================
FILE: es5/plugins/index.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _font = require('./font');

var _font2 = _interopRequireDefault(_font);

var _fill = require('./fill');

var _fill2 = _interopRequireDefault(_fill);

var _form = require('./form');

var _form2 = _interopRequireDefault(_form);

var _alignment = require('./alignment');

var _alignment2 = _interopRequireDefault(_alignment);

var _hyperlink = require('./hyperlink');

var _hyperlink2 = _interopRequireDefault(_hyperlink);

var _autoWidth = require('./autoWidth');

var _autoWidth2 = _interopRequireDefault(_autoWidth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = {
  fontPlugin: _font2.default,
  fillPlugin: _fill2.default,
  formPlugin: _form2.default,
  alignmentPlugin: _alignment2.default,
  hyperlinkPlugin: _hyperlink2.default,
  autoWidthPlugin: _autoWidth2.default
};

================================================
FILE: es5/table2excel.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _exceljs = require('exceljs/dist/es5/exceljs.browser');

var _exceljs2 = _interopRequireDefault(_exceljs);

var _utils = require('./utils');

var _constants = require('./constants');

var _plugins = require('./plugins');

var _plugins2 = _interopRequireDefault(_plugins);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

var PLUGIN_FUNCS = ['workbookCreated', 'worksheetCreated', 'worksheetCompleted', 'workcellCreated'];
var DEFAULT_WORKBOOK_OPTIONS = {
  views: [{
    x: 0, y: 0, width: 10000, height: 20000,
    firstSheet: 0, activeTab: 1, visibility: 'visible'
  }]
};
var DEFAULT_OPTIONS = {
  workbook: DEFAULT_WORKBOOK_OPTIONS,
  widthRatio: _constants.WIDTH_RATIO,
  plugins: [].concat(_toConsumableArray(Object.values(_plugins2.default)))
};

var Table2Excel = function () {
  function Table2Excel() {
    var _this = this;

    var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'table';
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    _classCallCheck(this, Table2Excel);

    this.tables = Array.from(typeof selector === 'string' ? document.querySelectorAll(selector) : selector);

    this.options = Object.assign({}, DEFAULT_OPTIONS, options);

    this.plugins = {};
    PLUGIN_FUNCS.forEach(function (funName) {
      _this.plugins[funName] = _this.options.plugins.filter(function (plugin) {
        return plugin[funName];
      }).map(function (plugin) {
        return plugin[funName];
      });
    });

    this.pluginContext = {};
  }

  _createClass(Table2Excel, [{
    key: '_invokePlugin',
    value: function _invokePlugin(func) {
      var _this2 = this;

      var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      this.pluginContext = Object.assign({}, this.pluginContext, context);
      this.plugins[func].forEach(function (handler) {
        return handler.call(_this2, _this2.pluginContext);
      });
    }
  }, {
    key: 'toExcel',
    value: function toExcel() {
      var _this3 = this;

      var tables = this.tables,
          options = this.options;

      var workbook = new _exceljs2.default.Workbook(); // create workbook

      Object.assign(workbook, options);

      // workbookCreated plugins
      this._invokePlugin('workbookCreated', { workbook: workbook, tables: tables });

      tables.forEach(function (table, index) {
        var worksheet = workbook.addWorksheet('Sheet ' + (index + 1));

        // worksheetCreated plugins
        _this3._invokePlugin('worksheetCreated', { worksheet: worksheet, table: table });

        _this3.toSheet(table, worksheet);

        // worksheetCompleted plugins
        _this3._invokePlugin('worksheetCompleted', { worksheet: worksheet, table: table });
      });

      return this.workbook = workbook;
    }
  }, {
    key: 'toSheet',
    value: function toSheet(table, worksheet) {
      var _this4 = this;

      // get total cols and rows
      var totalRows = table.rows.length;
      var totalCols = 0;

      if (table.rows.length > 0) {
        for (var i = 0; i < table.rows[0].cells.length; i++) {
          totalCols += table.rows[0].cells[i].colSpan;
        }
      }

      var cells = [];
      Array.from(table.rows).forEach(function (row) {
        Array.from(row.cells).forEach(function (cell) {
          cells.push({
            rowRange: {},
            colRange: {},
            el: cell
          });
        });
      });

      // create matrix
      var helperMatrix = [];

      for (var r = 0; r < totalRows; r++) {
        var row = [];
        for (var c = 0; c < totalCols; c++) {
          row.push({ cell: null });
        }
        helperMatrix.push(row);
      }

      // mark matrix
      var cursor = 0;

      for (var _r = 0; _r < totalRows; _r++) {
        for (var _c = 0; _c < totalCols; _c++) {
          // skip if current matrix unit is already assigned
          if (helperMatrix[_r][_c].cell) {
            continue;
          }

          // assign cell to current matrix unit
          var cell = cells[cursor++];
          var _cell$el = cell.el,
              rowSpan = _cell$el.rowSpan,
              colSpan = _cell$el.colSpan;


          cell.rowRange = { from: _r, to: _r };
          cell.colRange = { from: _c, to: _c };

          for (var y = _r; y < _r + rowSpan; y++) {
            for (var x = _c; x < _c + colSpan; x++) {
              helperMatrix[y][x].cell = cell;
              cell.colRange.to = x;
              cell.rowRange.to = y;
            }
          }
        }
      }

      // read matrix to sheet
      cells.forEach(function (cell) {
        var rowRange = cell.rowRange,
            colRange = cell.colRange,
            el = cell.el;
        var innerText = el.innerText;

        var workcell = (0, _utils.mergeCells)(worksheet, colRange.from, rowRange.from, colRange.to, rowRange.to);
        var cellStyle = getComputedStyle(el);

        workcell.value = innerText;

        // workcellCreated
        _this4._invokePlugin('workcellCreated', { workcell: workcell, cell: el, rowRange: rowRange, colRange: colRange, cellStyle: cellStyle });
      });
    }
  }, {
    key: 'export',
    value: function _export(fileName, ext) {
      if (!this.workbook) {
        this.toExcel();
      }
      (0, _utils.saveAsExcel)(this.workbook, fileName, ext);
    }
  }]);

  return Table2Excel;
}();

exports.default = Table2Excel;

================================================
FILE: es5/utils.js
================================================
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.argb = exports.mergeCells = exports.cellPosition = exports.columnIndex = exports.saveAsExcel = undefined;

var _constants = require('./constants');

var _fileSaver = require('file-saver');

var saveAsExcel = exports.saveAsExcel = function saveAsExcel(workbook) {
	var filename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'table';
	var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'xlsx';

	var type = _constants.MIME_TYPES[ext];

	if (!type) {
		console.error(ext + ' file extension is not supported');
		return;
	}

	workbook.xlsx.writeBuffer().then(function (uint8) {
		(0, _fileSaver.saveAs)(new Blob([uint8.buffer], { type: type }), filename + '.' + ext);
	});
};

var letter = function letter(num) {
	var a = 'A'.charCodeAt(0);
	return String.fromCharCode(a + num - 1);
};

/**
 * 0 => A
 * 25 => Z
 * 26 => AA
 */
var columnIndex = exports.columnIndex = function columnIndex(num) {
	var result = void 0;
	num = num + 1;

	if (num <= 26) {
		result = letter(num);
	} else {
		var mod = num % 26;
		var quotient = Math.floor(num / 26);

		if (mod === 0) {
			result = letter(quotient - 1) + letter(26);
		} else {
			result = letter(quotient) + letter(mod);
		}
	}
	return result;
};

// x = 0, y = 0 => 'A1'
// x = 0, y = 1 => 'A2'
// x = 1, y = 0 => 'B1'
var cellPosition = exports.cellPosition = function cellPosition(x, y) {
	return '' + columnIndex(x) + (y + 1);
};

var mergeCells = exports.mergeCells = function mergeCells(sheet, x1, y1, x2, y2) {
	var fromCell = cellPosition(x1, y1);
	var toCell = cellPosition(x2, y2);
	sheet.mergeCells(fromCell, toCell);
	return sheet.getCell(fromCell);
};

/**
 * convert rgb(0,0,0) rgba(0,0,0,0) to argb: FF00FF00
 */
var argb = exports.argb = function argb(color) {
	var values = color.split('(')[1].split(')')[0].split(',').map(function (v, i) {
		return i === 3 ? v * 255 : v;
	});

	if (values.length === 3) {
		values.push(255);
	}

	values.unshift(values.pop());

	return values.map(function (v) {
		var s = parseInt(v).toString(16);
		return s.length === 1 ? '0' + s : s;
	}).join('').toUpperCase();
};

================================================
FILE: package.json
================================================
{
  "name": "table2excel.js",
  "version": "1.0.0",
  "description": "",
  "main": "es5/index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack --config webpack.core.config.js -p && webpack --config webpack.umd.config.js -p",
    "build:es5": "babel src --out-dir es5"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jackgit/table2excel.js.git"
  },
  "keywords": [
    "table",
    "js",
    "excel",
    "xlsx",
    "xls"
  ],
  "author": "ygjack414@hotmail.com",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/jackgit/table2excel.js/issues"
  },
  "homepage": "https://github.com/jackgit/table2excel.js#readme",
  "dependencies": {
    "file-saver": "^1.3.3"
  },
  "peerDependencies": {
    "exceljs": "^0.6.2"
  },
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-1": "^6.24.1",
    "cross-env": "^5.2.0"
  }
}


================================================
FILE: src/constants.js
================================================
export const MIME_TYPES = {
  xls: 'application/vnd.ms-excel',
  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
}

export const WIDTH_RATIO = .14


================================================
FILE: src/index.js
================================================
import Table2Excel from './table2excel'
import plugins from './plugins'
import * as utils from './utils'

Table2Excel.plugins = plugins
Table2Excel.utils = utils

export default Table2Excel


================================================
FILE: src/plugins/alignment.js
================================================
/**
 * '-webkit-right' -> 'right'
 * 'right' -> 'right'
 *  etc...
 */
const getHorizontalAlign = (value = '') => {
  const aligns = ['right', 'left', 'center', 'justify']
  for (let i = 0; i < aligns.length; i++) {
    if (value.includes(aligns[i])) {
      return aligns[i]
    }
  }
}

/**
 * 'baseline' -> 'middle'
 * 'text-top' -> 'top'
 * 'text-bottom' -> 'bottom'
 * 'sub' -> 'top'
 * 'super' -> 'bottom'
 */
const getVerticalAlign = (value = '') => {
  const aligns = ['top', 'middle', 'bottom']
  for (let i = 0; i < aligns.length; i++) {
    if (value.includes(aligns[i])) {
      return aligns[i]
    }
  }

  const mapping = {
    'baseline': 'middle',
    'super': 'top',
    'sub': 'bottom'
  }
  return mapping[value]
}

export default {
  workcellCreated ({ workcell, cellStyle }) {
    const { verticalAlign, textAlign } = cellStyle
    workcell.alignment = {
      ...(workcell.alignment || {}),
      ...({
        vertical: getVerticalAlign(verticalAlign),
        horizontal: getHorizontalAlign(textAlign)
      })
    }
  }
}


================================================
FILE: src/plugins/autoWidth.js
================================================
export default {
  workcellCreated ({ worksheet, colRange, cell, cellStyle }) {
    if (colRange.from === colRange.to && cellStyle.width !== 'auto') {
      worksheet.getColumn(colRange.from + 1).width = (+cellStyle.width.split('px')[0]) * this.options.widthRatio
    }
  }
}


================================================
FILE: src/plugins/fill.js
================================================
import { argb } from '../utils'

export default {
  workcellCreated ({ workcell, cellStyle }) {
    const color = argb(cellStyle.backgroundColor)

    if (color === '00000000') {
      // background is transparent, equals none pattern fill
      workcell.fill = {
        ...(workcell.fill || {}),
        ...({
          type: 'pattern',
          pattern: 'none'
        })
      }
    } else {
      workcell.fill = {
        ...(workcell.fill || {}),
        ...({
          type: 'pattern',
          pattern: 'solid',
          fgColor: { argb: color }
        })
      }
    }
  }
}


================================================
FILE: src/plugins/font.js
================================================
import { argb } from '../utils'

export default {
  workcellCreated ({ workcell, cellStyle }) {
    const fontWeight = cellStyle.fontWeight

    workcell.font = {
      ...(workcell.font || {}),
      ...({
        name: cellStyle.fontFamily,
        color: { argb: argb(cellStyle.color) },
        bold: (fontWeight === 'bold' || +fontWeight > 600) ? true : false
      })
    }
  }
}


================================================
FILE: src/plugins/form.js
================================================
export default {
  workcellCreated ({ workcell, cell }) {
    const child = cell.children[0]
    if (child && ['INPUT', 'SELECT', 'TEXTAREA'].includes(child.tagName)) {
      workcell.value = child.value
    }
  }
}


================================================
FILE: src/plugins/hyperlink.js
================================================
export default {
  workcellCreated ({ workcell, cell }) {
    const child = cell.children[0]
    if (child && child.tagName === 'A') {
      workcell.value = { text: child.innerText, hyperlink: child.href }
    }
  }
}


================================================
FILE: src/plugins/index.js
================================================
import fontPlugin from './font'
import fillPlugin from './fill'
import formPlugin from './form'
import alignmentPlugin from './alignment'
import hyperlinkPlugin from './hyperlink'
import autoWidthPlugin from './autoWidth'

export default {
  fontPlugin,
  fillPlugin,
  formPlugin,
  alignmentPlugin,
  hyperlinkPlugin,
  autoWidthPlugin
}


================================================
FILE: src/table2excel.js
================================================
import ExcelJS from 'exceljs/dist/es5/exceljs.browser'
import { mergeCells, saveAsExcel } from './utils'
import { WIDTH_RATIO } from './constants'
import plugins from './plugins'

const PLUGIN_FUNCS = ['workbookCreated', 'worksheetCreated', 'worksheetCompleted', 'workcellCreated']
const DEFAULT_WORKBOOK_OPTIONS = {
  views: [{
    x: 0, y: 0, width: 10000, height: 20000,
    firstSheet: 0, activeTab: 1, visibility: 'visible'
  }]
}
const DEFAULT_OPTIONS = {
  workbook: DEFAULT_WORKBOOK_OPTIONS,
  widthRatio: WIDTH_RATIO,
  plugins: [...Object.values(plugins)]
}

export default class Table2Excel {

  constructor (selector = 'table', options = {}) {
    this.tables = Array.from(
      typeof selector === 'string'
        ? document.querySelectorAll(selector)
        : selector
      )

    this.options = Object.assign({}, DEFAULT_OPTIONS, options)

    this.plugins = {}
    PLUGIN_FUNCS.forEach(funName => {
      this.plugins[funName] = this.options.plugins.filter(plugin => plugin[funName]).map(plugin => plugin[funName])
    })

    this.pluginContext = {}
  }

  _invokePlugin (func, context = {}) {
    this.pluginContext = Object.assign({}, this.pluginContext, context)
    this.plugins[func].forEach(handler => handler.call(this, this.pluginContext))
  }

  toExcel () {
    const { tables, options } = this
    const workbook = new ExcelJS.Workbook() // create workbook

    Object.assign(workbook, options)

    // workbookCreated plugins
    this._invokePlugin('workbookCreated', { workbook, tables })

    tables.forEach((table, index) => {
      const worksheet = workbook.addWorksheet(`Sheet ${index + 1}`)

      // worksheetCreated plugins
      this._invokePlugin('worksheetCreated', { worksheet, table })

      this.toSheet(table, worksheet)

      // worksheetCompleted plugins
      this._invokePlugin('worksheetCompleted', { worksheet, table })
    })

    return this.workbook = workbook
  }

  toSheet (table, worksheet) {
    // get total cols and rows
    const totalRows = table.rows.length
    let totalCols = 0

    if (table.rows.length > 0) {
      for (let i = 0; i < table.rows[0].cells.length; i++) {
        totalCols += table.rows[0].cells[i].colSpan
      }
    }

    const cells = []
    Array.from(table.rows).forEach(row => {
      Array.from(row.cells).forEach(cell => {
        cells.push({
          rowRange: {},
          colRange: {},
          el: cell
        })
      })
    })

    // create matrix
    const helperMatrix = []

    for (let r = 0; r < totalRows; r++) {
      const row = []
      for (let c = 0; c < totalCols; c++) {
        row.push({ cell: null })
      }
      helperMatrix.push(row)
    }


    // mark matrix
    let cursor = 0

    for (let r = 0; r < totalRows; r++) {
      for (let c = 0; c < totalCols; c++) {
        // skip if current matrix unit is already assigned
        if (helperMatrix[r][c].cell) {
          continue
        }

        // assign cell to current matrix unit
        const cell = cells[cursor++]
        const { rowSpan, colSpan } = cell.el

        cell.rowRange = { from: r, to: r }
        cell.colRange = { from: c, to: c }

        for (let y = r; y < r + rowSpan; y++) {
          for (let x = c; x < c + colSpan; x++) {
            helperMatrix[y][x].cell = cell
            cell.colRange.to = x
            cell.rowRange.to = y
          }
        }
      }
    }


    // read matrix to sheet
    cells.forEach(cell => {
      const { rowRange, colRange, el } = cell
      const { innerText } = el
      const workcell = mergeCells(worksheet, colRange.from, rowRange.from, colRange.to, rowRange.to)
      const cellStyle = getComputedStyle(el)

      workcell.value = innerText

      // workcellCreated
      this._invokePlugin('workcellCreated', { workcell, cell: el, rowRange, colRange, cellStyle })
    })
  }

  export (fileName, ext) {
    if (!this.workbook) {
      this.toExcel()
    }
    saveAsExcel(this.workbook, fileName, ext)
  }
}


================================================
FILE: src/utils.js
================================================
import { MIME_TYPES } from './constants'
import { saveAs } from 'file-saver'

export const saveAsExcel = (workbook, filename = 'table', ext = 'xlsx') => {
	const type = MIME_TYPES[ext]

	if (!type) {
		console.error(`${ext} file extension is not supported`)
		return
	}

	workbook.xlsx.writeBuffer().then(uint8 => {
		saveAs(
      new Blob([uint8.buffer], { type }),
      `${filename}.${ext}`
    )
	})
}

const letter = num => {
	const a = 'A'.charCodeAt(0)
	return String.fromCharCode(a + num - 1)
}

/**
 * 0 => A
 * 25 => Z
 * 26 => AA
 */
export const columnIndex = num => {
	let result
	num = num + 1

	if (num <= 26) {
		result = letter(num)
	} else {
		const mod = num % 26
		const quotient = Math.floor(num / 26)

		if (mod === 0) {
			result = letter(quotient - 1) + letter(26)
		} else {
			result = letter(quotient) + letter(mod)
		}
	}
	return result
}

// x = 0, y = 0 => 'A1'
// x = 0, y = 1 => 'A2'
// x = 1, y = 0 => 'B1'
export const cellPosition = (x, y) => {
  return `${columnIndex(x)}${y + 1}`
}

export const mergeCells = (sheet, x1, y1, x2, y2) => {
  const fromCell = cellPosition(x1, y1)
  const toCell = cellPosition(x2, y2)
  sheet.mergeCells(fromCell, toCell)
  return sheet.getCell(fromCell)
}

/**
 * convert rgb(0,0,0) rgba(0,0,0,0) to argb: FF00FF00
 */
export const argb = color => {
	const values = color
		.split('(')[1].split(')')[0].split(',')
		.map((v, i) => i === 3 ? v * 255 : v)

	if (values.length === 3) {
		values.push(255)
	}

	values.unshift(values.pop())

	return values.map(v => {
		const s = parseInt(v).toString(16)
		return s.length === 1 ? `0${s}` : s
	}).join('').toUpperCase()
}


================================================
FILE: webpack.core.config.js
================================================
module.exports = {
  entry: './src/index.js',
  output: {
    filename: './dist/table2excel.core.js',
    library: 'Table2Excel',
    libraryTarget: 'umd',
    libraryExport: 'default'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [
          'babel-loader',
        ],
        exclude: /node_modules/
      }
    ]
  },
  externals: {
    'exceljs/dist/es5/exceljs.browser': 'ExcelJS'
  },
  node: {
    fs: 'empty'
  }
};


================================================
FILE: webpack.umd.config.js
================================================
module.exports = {
  entry: './src/index.js',
  output: {
    filename: './dist/table2excel.min.js',
    library: 'Table2Excel',
    libraryTarget: 'umd',
    libraryExport: 'default'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [
          'babel-loader',
        ],
        exclude: /node_modules/
      }
    ]
  },
  node: {
    fs: 'empty'
  }
};
Download .txt
gitextract_ca7o4bbr/

├── .babelrc
├── .gitignore
├── README.md
├── dist/
│   └── table2excel.core.js
├── docs/
│   ├── index.html
│   └── js/
│       └── table2excel.core.js
├── es5/
│   ├── constants.js
│   ├── index.js
│   ├── plugins/
│   │   ├── alignment.js
│   │   ├── autoWidth.js
│   │   ├── fill.js
│   │   ├── font.js
│   │   ├── form.js
│   │   ├── hyperlink.js
│   │   └── index.js
│   ├── table2excel.js
│   └── utils.js
├── package.json
├── src/
│   ├── constants.js
│   ├── index.js
│   ├── plugins/
│   │   ├── alignment.js
│   │   ├── autoWidth.js
│   │   ├── fill.js
│   │   ├── font.js
│   │   ├── form.js
│   │   ├── hyperlink.js
│   │   └── index.js
│   ├── table2excel.js
│   └── utils.js
├── webpack.core.config.js
└── webpack.umd.config.js
Download .txt
SYMBOL INDEX (37 symbols across 13 files)

FILE: dist/table2excel.core.js
  function n (line 1) | function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{...
  function c (line 1) | function c(e){return e&&e.__esModule?e:{default:e}}
  function i (line 1) | function i(e){return e&&e.__esModule?e:{default:e}}
  function e (line 1) | function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.en...
  function u (line 1) | function u(e){return e&&e.__esModule?e:{default:e}}
  function e (line 1) | function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?argu...

FILE: docs/js/table2excel.core.js
  function n (line 1) | function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{...
  function c (line 1) | function c(e){return e&&e.__esModule?e:{default:e}}
  function i (line 1) | function i(e){return e&&e.__esModule?e:{default:e}}
  function e (line 1) | function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.en...
  function u (line 1) | function u(e){return e&&e.__esModule?e:{default:e}}
  function e (line 1) | function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?argu...

FILE: es5/index.js
  function _interopRequireWildcard (line 19) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
  function _interopRequireDefault (line 21) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...

FILE: es5/plugins/index.js
  function _interopRequireDefault (line 31) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...

FILE: es5/table2excel.js
  function defineProperties (line 7) | function defineProperties(target, props) { for (var i = 0; i < props.len...
  function _interopRequireDefault (line 21) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
  function _classCallCheck (line 23) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
  function _toConsumableArray (line 25) | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i ...
  function Table2Excel (line 41) | function Table2Excel() {

FILE: src/constants.js
  constant MIME_TYPES (line 1) | const MIME_TYPES = {
  constant WIDTH_RATIO (line 6) | const WIDTH_RATIO = .14

FILE: src/plugins/alignment.js
  method workcellCreated (line 39) | workcellCreated ({ workcell, cellStyle }) {

FILE: src/plugins/autoWidth.js
  method workcellCreated (line 2) | workcellCreated ({ worksheet, colRange, cell, cellStyle }) {

FILE: src/plugins/fill.js
  method workcellCreated (line 4) | workcellCreated ({ workcell, cellStyle }) {

FILE: src/plugins/font.js
  method workcellCreated (line 4) | workcellCreated ({ workcell, cellStyle }) {

FILE: src/plugins/form.js
  method workcellCreated (line 2) | workcellCreated ({ workcell, cell }) {

FILE: src/plugins/hyperlink.js
  method workcellCreated (line 2) | workcellCreated ({ workcell, cell }) {

FILE: src/table2excel.js
  constant PLUGIN_FUNCS (line 6) | const PLUGIN_FUNCS = ['workbookCreated', 'worksheetCreated', 'worksheetC...
  constant DEFAULT_WORKBOOK_OPTIONS (line 7) | const DEFAULT_WORKBOOK_OPTIONS = {
  constant DEFAULT_OPTIONS (line 13) | const DEFAULT_OPTIONS = {
  class Table2Excel (line 19) | class Table2Excel {
    method constructor (line 21) | constructor (selector = 'table', options = {}) {
    method _invokePlugin (line 38) | _invokePlugin (func, context = {}) {
    method toExcel (line 43) | toExcel () {
    method toSheet (line 67) | toSheet (table, worksheet) {
    method export (line 143) | export (fileName, ext) {
Condensed preview — 31 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (102K chars).
[
  {
    "path": ".babelrc",
    "chars": 49,
    "preview": "{\n  \"presets\":[\n    \"es2015\",\n    \"stage-1\"\n  ]\n}"
  },
  {
    "path": ".gitignore",
    "chars": 883,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directo"
  },
  {
    "path": "README.md",
    "chars": 4595,
    "preview": "# Table2Excel.js\n\nThis is a library to export html tables to excel sheets.\n\n## Precondition\n\nIt has to be a row * column"
  },
  {
    "path": "dist/table2excel.core.js",
    "chars": 11108,
    "preview": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"ExcelJS\")):\"function\"==typeof"
  },
  {
    "path": "docs/index.html",
    "chars": 39780,
    "preview": "<html><head>\n    <meta charset=\"utf-8\">\n    <title></title>\n    <script src=\"js/exceljs.min.js\"></script>\n    <script sr"
  },
  {
    "path": "docs/js/table2excel.core.js",
    "chars": 11108,
    "preview": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"ExcelJS\")):\"function\"==typeof"
  },
  {
    "path": "es5/constants.js",
    "chars": 279,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nvar MIME_TYPES = exports.MIME_TYPES = {\n"
  },
  {
    "path": "es5/index.js",
    "chars": 852,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _table2excel = require('./table2exc"
  },
  {
    "path": "es5/plugins/alignment.js",
    "chars": 1684,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends = Object.assign || functio"
  },
  {
    "path": "es5/plugins/autoWidth.js",
    "chars": 480,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = {\n  workcellCreated: f"
  },
  {
    "path": "es5/plugins/fill.js",
    "chars": 967,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends = Object.assign || functio"
  },
  {
    "path": "es5/plugins/font.js",
    "chars": 794,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends = Object.assign || functio"
  },
  {
    "path": "es5/plugins/form.js",
    "chars": 371,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = {\n  workcellCreated: f"
  },
  {
    "path": "es5/plugins/hyperlink.js",
    "chars": 374,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = {\n  workcellCreated: f"
  },
  {
    "path": "es5/plugins/index.js",
    "chars": 931,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _font = require('./font');\n\nvar _fo"
  },
  {
    "path": "es5/table2excel.js",
    "chars": 6474,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _createClass = function () { functi"
  },
  {
    "path": "es5/utils.js",
    "chars": 2202,
    "preview": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports.argb = exports.mergeCells = expor"
  },
  {
    "path": "package.json",
    "chars": 1035,
    "preview": "{\n  \"name\": \"table2excel.js\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"es5/index.js\",\n  \"scripts\": {\n    \"t"
  },
  {
    "path": "src/constants.js",
    "chars": 173,
    "preview": "export const MIME_TYPES = {\n  xls: 'application/vnd.ms-excel',\n  xlsx: 'application/vnd.openxmlformats-officedocument.sp"
  },
  {
    "path": "src/index.js",
    "chars": 190,
    "preview": "import Table2Excel from './table2excel'\nimport plugins from './plugins'\nimport * as utils from './utils'\n\nTable2Excel.pl"
  },
  {
    "path": "src/plugins/alignment.js",
    "chars": 1048,
    "preview": "/**\n * '-webkit-right' -> 'right'\n * 'right' -> 'right'\n *  etc...\n */\nconst getHorizontalAlign = (value = '') => {\n  co"
  },
  {
    "path": "src/plugins/autoWidth.js",
    "chars": 276,
    "preview": "export default {\n  workcellCreated ({ worksheet, colRange, cell, cellStyle }) {\n    if (colRange.from === colRange.to &&"
  },
  {
    "path": "src/plugins/fill.js",
    "chars": 590,
    "preview": "import { argb } from '../utils'\n\nexport default {\n  workcellCreated ({ workcell, cellStyle }) {\n    const color = argb(c"
  },
  {
    "path": "src/plugins/font.js",
    "chars": 386,
    "preview": "import { argb } from '../utils'\n\nexport default {\n  workcellCreated ({ workcell, cellStyle }) {\n    const fontWeight = c"
  },
  {
    "path": "src/plugins/form.js",
    "chars": 216,
    "preview": "export default {\n  workcellCreated ({ workcell, cell }) {\n    const child = cell.children[0]\n    if (child && ['INPUT', "
  },
  {
    "path": "src/plugins/hyperlink.js",
    "chars": 219,
    "preview": "export default {\n  workcellCreated ({ workcell, cell }) {\n    const child = cell.children[0]\n    if (child && child.tagN"
  },
  {
    "path": "src/plugins/index.js",
    "chars": 340,
    "preview": "import fontPlugin from './font'\nimport fillPlugin from './fill'\nimport formPlugin from './form'\nimport alignmentPlugin f"
  },
  {
    "path": "src/table2excel.js",
    "chars": 3970,
    "preview": "import ExcelJS from 'exceljs/dist/es5/exceljs.browser'\nimport { mergeCells, saveAsExcel } from './utils'\nimport { WIDTH_"
  },
  {
    "path": "src/utils.js",
    "chars": 1637,
    "preview": "import { MIME_TYPES } from './constants'\nimport { saveAs } from 'file-saver'\n\nexport const saveAsExcel = (workbook, file"
  },
  {
    "path": "webpack.core.config.js",
    "chars": 452,
    "preview": "module.exports = {\n  entry: './src/index.js',\n  output: {\n    filename: './dist/table2excel.core.js',\n    library: 'Tabl"
  },
  {
    "path": "webpack.umd.config.js",
    "chars": 381,
    "preview": "module.exports = {\n  entry: './src/index.js',\n  output: {\n    filename: './dist/table2excel.min.js',\n    library: 'Table"
  }
]

About this extraction

This page contains the full source code of the JackGit/table2excel.js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 31 files (91.6 KB), approximately 32.2k tokens, and a symbol index with 37 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!