Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    [[1,2,33,5], [2,10,15,16], [3,1,21,20]]

    返回HTML,表格渲染 列最大值突出显示 不能使用函数库
  <div class="box"></div>



    text-align: center;
    margin: 0 auto;
    display: inline-block;
    text-align: center;
    border: 1px solid #aaa;
    border: 1px solid #ccc;
    padding: 0.6em;
    width: 1.4em;
    height: 1.4em;
    background: #edf;


                var arr = [[1, 2, 33 ,5], [2, 10, 15, 16], [3, 1, 21, 20]],
        len = arr.length,
        str = "<table>";

    for (var i = 0; i < len; i++) { // 行遍历
      len1 = arr[i].length;
      str += "<tr>";

      for (var j = 0; j < len1; j++) {
        var colM,cla='',max = 0; // 在列遍历这里定义这三个变量很重要
        for (var k = 0; k < len; k++) {
          if (max < arr[k][j]) {
            max = arr[k][j];
            colM = k;
        if (arr[i][j] === max) {cla = 'colMax';console.log(colM,j,max)}

        str += "<td class='"+ cla +"'>"+ arr[i][j] +"</td>";
      str += "</tr>";

    str += "</table>";

    document.getElementsByClassName('box')[0].innerHTML = str;