Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 亚洲精品一区二区手机在线,国产三级在线精品男人的天堂,国产精品久久天天影视

          整合營(yíng)銷服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢熱線:

          x-spreadsheet-Web端優(yōu)秀的Javas

          x-spreadsheet-Web端優(yōu)秀的Javascript電子表格

          x-spreadsheet是一款開(kāi)源的基于Web的Javascript電子表格,在Github獲得6k+的star,它在功能上有點(diǎn)類似于google sheet,可以說(shuō)是簡(jiǎn)化版的web excel,雖然沒(méi)excel那么強(qiáng)大,但也能夠應(yīng)付一些需求了。

          Github和體驗(yàn)地址

          Github:https://github.com/myliang/x-spreadsheet

          DEMO:https://myliang.github.io/x-spreadsheet/

          安裝

          提供兩種方式

          • 直接引用(使用cdn或者下載到本地)
          <link rel="stylesheet" >
          <script src="https://unpkg.com/x-data-spreadsheet@1.0.21/dist/xspreadsheet.js"></script>
          
          • NPM安裝
          npm install x-data-spreadsheet
          

          使用方式

          <div id="xspreadsheet"></div>
          <script>
           x.spreadsheet('#xspreadsheet');
          </script>
          

          在瀏覽器運(yùn)行結(jié)果如圖:

          或者你也可以使用模塊化的方式使用

          import Spreadsheet from "x-data-spreadsheet";
          // If you need to override the default options, you can set the override
          // const options={};
          // new Spreadsheet('#x-spreadsheet-demo', options);
          const s=new Spreadsheet("#x-spreadsheet-demo")
           .loadData({}) // load data
           .change(data=> {
           // save data to db
           });
          // data validation
          s.validate()
          

          所有默認(rèn)的配置

          {
           showToolbar: true,
           showGrid: true,
           showContextmenu: true,
           view: {
           height: ()=> document.documentElement.clientHeight,
           width: ()=> document.documentElement.clientWidth,
           },
           row: {
           len: 100,
           height: 25,
           },
           col: {
           len: 26,
           width: 100,
           indexWidth: 60,
           minWidth: 60,
           },
           style: {
           bgcolor: '#ffffff',
           align: 'left',
           valign: 'middle',
           textwrap: false,
           strike: false,
           underline: false,
           color: '#0a0a0a',
           font: {
           name: 'Helvetica',
           size: 10,
           bold: false,
           italic: false,
           },
           },
          }
          

          國(guó)際化

          <!-- Import via CDN -->
          <link rel="stylesheet" >
          <script src="https://unpkg.com/x-data-spreadsheet@1.0.21/dist/xspreadsheet.js"></script>
          <script src="https://unpkg.com/x-data-spreadsheet@1.0.21/dist/locale/zh-cn.js"></script>
          <script>
           x.spreadsheet.locale('zh-cn');
          </script>
          

          或者

          // npm 
          import Spreadsheet from 'x-data-spreadsheet';
          import zhCN from 'x-data-spreadsheet/dist/locale/zh-cn';
          Spreadsheet.locale('zh-cn', zhCN);
          new Spreadsheet(document.getElementById('xss-demo'));
          

          上圖是我測(cè)試中文的

          功能

          它包含了一些基本用得到的功能

          • 撤銷和重做
          • 背景色
          • 格式清除
          • 格式化
          • 字型
          • 字體大小
          • 字體粗體
          • 字體斜體
          • 下劃線
          • 刪除線
          • 文本顏色
          • 填充顏色
          • 邊界
          • 合并單元格
          • 對(duì)齊
          • 文本換行
          • 固定單元格
          • 函數(shù)
          • 調(diào)整尺寸行高,寬
          • 復(fù)制,剪切,粘貼
          • 自動(dòng)填充
          • 插入行、列
          • 刪除行、列
          • 數(shù)據(jù)驗(yàn)證

          完整實(shí)例代碼,可直接運(yùn)行

          <!DOCTYPE html>
          <html lang="en">
          
          <head>
           <meta charset="UTF-8">
           <meta name="viewport" content="width=device-width, initial-scale=1.0">
           <meta http-equiv="X-UA-Compatible" content="ie=edge">
           <title>x-spreadsheet</title>
           <link rel="stylesheet" >
           <script src="https://unpkg.com/x-data-spreadsheet@1.0.21/dist/xspreadsheet.js"></script>
           <script src="https://unpkg.com/x-data-spreadsheet@1.0.21/dist/locale/zh-cn.js"></script>
          </head>
          
          <body onload="load()">
           <div id="x-spreadsheet-demo"></div>
           <script>
           function load() {
           x.spreadsheet.locale('zh-cn');
           var table=x.spreadsheet('#x-spreadsheet-demo', {})
           .loadData({
           freeze: 'B3',
           styles: [{
           bgcolor: '#f4f5f8',
           textwrap: true,
           color: '#900b09',
           border: {
           top: ['thin', '#0366d6'],
           bottom: ['thin', '#0366d6'],
           right: ['thin', '#0366d6'],
           left: ['thin', '#0366d6'],
           },
           }, ],
           merges: [
           'C3:D4',
           ],
           rows: {
           1: {
           cells: {
           0: {
           text: 'testingtesttestetst'
           },
           2: {
           text: 'testing'
           },
           },
           },
           2: {
           cells: {
           0: {
           text: 'render',
           style: 0
           },
           1: {
           text: 'Hello'
           },
           2: {
           text: 'haha',
           merge: [1, 1]
           },
           }
           },
           8: {
           cells: {
           8: {
           text: 'border test',
           style: 0
           },
           }
           }
           },
           });
          
           table.change((cdata)=> {
           // console.log(cdata);
           console.log(table.validate());
           console.log(table);
           });
           }
           </script>
          
          
          </body>
          
          </html>
          

          兼容性

          支持主流瀏覽器(chrome, firefox, Safari),Edge貌似有問(wèn)題,本地測(cè)試未通過(guò)

          總結(jié)

          值得注意的是在Github提供的cdn中版本號(hào)較低,在國(guó)際化的時(shí)候會(huì)出現(xiàn)錯(cuò)誤,因此在更改官網(wǎng)的cdn版本至1.0.21即可,可以直接使用我上面更改后的,已經(jīng)親自測(cè)試過(guò),如果你覺(jué)得它對(duì)你有幫助,請(qǐng)麻煩點(diǎn)贊、轉(zhuǎn)發(fā)加關(guān)注喲!后續(xù)更多實(shí)用技巧和工具等著你!

          件化寫法:

          HTML:

          <div class="wrape">

          <div class="tab clearfix">

          <div class="t-item">tab1</div>

          <div class="t-item">tab2</div>

          <div class="t-item cur">tab3</div>

          <div class="t-item">tab4</div>

          <div class="t-item">tab5</div>

          </div>

          <div class="page">

          <div class="p-item cur">頁(yè)面1</div>

          <div class="p-item">頁(yè)面2</div>

          <div class="p-item">頁(yè)面3</div>

          <div class="p-item">頁(yè)面4</div>

          <div class="p-item">頁(yè)面5</div>

          </div>

          </div>


          css:

          .wrap{height:500px;width:80%;margin:50px auto;box-shadow:5px #ccc;}.fl{float:left;}.clearfix:after{content:'';display:table;clear:both;}.tab .t-item{float:left;width:20%;text-align:center;border:1px solid #ccc;box-sizing:border-box;padding:10px 0;cursor:pointer;}.tab .t-item.cur{color:red;background:#efefef;}.page{position:relative;height:450px;}.page .p-item{display:none;line-height:100px;height:100px;text-align:center;position:absolute;top:0px;left:0;height:100%;width:100%;}.page .p-item.cur{display:block;}

          效果預(yù)覽:


          js:

          天小編為大家介紹五種css樣式布局以及內(nèi)服源代碼作為介紹,采用的方式是行內(nèi)級(jí)樣式(就是將css樣式代碼與html寫在一起)

          已知布局元素的高度,寫出三欄布局,要求左欄、右欄寬度各為300px,中間自適應(yīng)。

          一、浮動(dòng)布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>浮動(dòng)布局</title>

          <style type="text/css">

          .wrap1 div{

          min-height: 200px;

          }

          .wrap1 .left{

          float: left;

          width: 300px;

          background: red;

          }

          .wrap1 .right{

          float: right;

          width: 300px;

          background: blue;

          }

          .wrap1 .center{

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap1">

          <div class="left"></div>

          <div class="right"></div>

          <div class="center">

          浮動(dòng)布局

          </div>

          </div>

          </body>

          </html>

          浮動(dòng)布局的兼容性比較好,但是浮動(dòng)帶來(lái)的影響比較多,頁(yè)面寬度不夠的時(shí)候會(huì)影響布局。

          二、絕對(duì)定位布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>絕對(duì)定位布局</title>

          <style type="text/css">

          .wrap2 div{

          position: absolute;

          min-height: 200px;

          }

          .wrap2 .left{

          left: 0;

          width: 300px;

          background: red;

          }

          .wrap2 .right{

          right: 0;

          width: 300px;

          background: blue;

          }

          .wrap2 .center{

          left: 300px;

          right: 300px;

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap2 wrap">

          <div class="left"></div>

          <div class="center">

          絕對(duì)定位布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          絕對(duì)定位布局快捷,但是有效性比較差,因?yàn)槊撾x了文檔流。

          三、flex布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>flex布局</title>

          <style type="text/css">

          .wrap3{

          display: flex;

          min-height: 200px;

          }

          .wrap3 .left{

          flex-basis: 300px;

          background: red;

          }

          .wrap3 .right{

          flex-basis: 300px;

          background: blue;

          }

          .wrap3 .center{

          flex: 1;

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap3 wrap">

          <div class="left"></div>

          <div class="center">

          flex布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          自適應(yīng)好,高度能夠自動(dòng)撐開(kāi)

          四、table-cell表格布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>table-cell表格布局</title>

          <style type="text/css">

          .wrap4{

          display: table;

          width: 100%;

          height: 200px;

          }

          .wrap4>div{

          display: table-cell;

          }

          .wrap4 .left{

          width: 300px;

          background: red;

          }

          .wrap4 .right{

          width: 300px;

          background: blue;

          }

          .wrap4 .center{

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap4 wrap">

          <div class="left"></div>

          <div class="center">

          表格布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          兼容性好,但是有時(shí)候不能固定高度,因?yàn)闀?huì)被內(nèi)容撐高。

          五、網(wǎng)格布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>網(wǎng)格布局</title>

          <style type="text/css">

          .wrap5{

          display: grid;

          width: 100%;

          grid-template-rows: 200px;

          grid-template-columns: 300px auto 300px;

          }

          .wrap5 .left{

          background: red;

          }

          .wrap5 .right{

          background: blue;

          }

          .wrap5 .center{

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap5 wrap">

          <div class="left"></div>

          <div class="center">

          網(wǎng)格布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          希望大家可以一直關(guān)注我,支持我!感謝!!!


          主站蜘蛛池模板: 99久久精品国产高清一区二区| 无码人妻AV免费一区二区三区| 无码一区二区三区视频| 天堂一区人妻无码| 亚洲一区综合在线播放| 亚洲第一区精品日韩在线播放| 日韩成人无码一区二区三区| 日韩人妻一区二区三区蜜桃视频| 国产在线观看一区二区三区精品| 欧洲亚洲综合一区二区三区| 亚洲综合色一区二区三区小说| 成人精品一区二区三区不卡免费看| 国产一区二区三区不卡在线观看| 中文乱码人妻系列一区二区| 老熟妇仑乱一区二区视頻| 日韩精品一区二区三区大桥未久 | 国产另类ts人妖一区二区三区| 久久精品日韩一区国产二区| 在线视频一区二区三区| 无码人妻精品一区二区| 精品一区二区三区波多野结衣| 国产一区二区三区在线看| 中文字幕精品一区二区三区视频| 中文日韩字幕一区在线观看| 好吊视频一区二区三区| 中文字幕一区二区三区永久| 在线视频一区二区三区三区不卡| 中文字幕精品无码一区二区 | 国产成人一区二区三区| 久久久无码精品人妻一区| 日韩一区二区免费视频| 国产成人精品无人区一区| 无人码一区二区三区视频| 久久精品视频一区二区三区| 日韩人妻无码一区二区三区久久| 国产福利微拍精品一区二区| 国产精品无码亚洲一区二区三区 | 国产一区二区三区在线影院| 国产成人无码AV一区二区 | 波多野结衣电影区一区二区三区 | 亚洲中文字幕乱码一区|