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
xcel中,經(jīng)常會(huì)碰到與圖片相關(guān)的一些操作,今天將與圖片操作相關(guān)的一些技巧整理了,給大家分享。
如下圖所示,在C列中批量插入與B列同名的圖片
操作步驟:
在C2單元格輸入公式:
="<table><img src=""F:\EXCEL\"&B2&".jpg""width=""120""height=""90"">"
其中“F:\EXCEL\”為圖片所在的地址。
"width=""120""height=""90" 為圖片插入后的寬度和高度
下拉C2單元格
將C列中,剛剛輸入了公式的所有單元格的內(nèi)容,復(fù)制到記事本中
再將記事本中的內(nèi)容,重新復(fù)制回C列,即可
這樣在C列的單元格中,就插入了與B列同名的圖片
具體操作如下:
將Excel文件另存為Html文件,即可
具體操作如下:
選中某一個(gè)圖片后,按快捷鍵“Ctrl + A”,再按刪除鍵,即可
具體操作如下:
操作步驟:
選中圖片,點(diǎn)擊右鍵,選擇“設(shè)置圖片格式”
在“設(shè)置圖片格式”,大小屬性中取消“鎖定縱橫比”,同時(shí)勾選“大小和位置隨單元格而變”
按住“Alt”鍵,拖動(dòng)圖片的左上角和右上角到單元格的對(duì)應(yīng)位置
具體操作如下:
如下圖所示,復(fù)制單元格區(qū)域A1:B5,再選擇性粘貼中,選擇“鏈接的圖片”,即可
具體操作如下:
點(diǎn)擊“頁面設(shè)置”,在彈出的“頁面設(shè)置”對(duì)話框中的“工作表”頁面中,勾選“草稿品質(zhì)”,然后在打印,即可
具體操作如下:
以上就是Excel中與圖片相關(guān)的一些操作。如果覺得好,就點(diǎn)個(gè)贊吧
有天老板找我到辦公室跟我說要做一個(gè)商城,商城賣出去東西就有傭金可以拿。我聽著就頭大。老板打開電腦給我看了網(wǎng)站:你看一下這個(gè)網(wǎng)站,照著它的流程就可以擁有一個(gè)商城了。我靠過去一看,大概了解一下:原來是利用第三方工具就可以構(gòu)建一個(gè)導(dǎo)購網(wǎng)站,只要消費(fèi)者在網(wǎng)站領(lǐng)取優(yōu)惠券就會(huì)自動(dòng)跳轉(zhuǎn)到某bao的購買頁面,購買成功后就可以有傭金了。我看了一下覺得可以,只要不讓我敲代碼一切好說。于是我照著流程構(gòu)建了一個(gè)網(wǎng)站,然后勾選了很多零食進(jìn)行推廣,然后我就發(fā)現(xiàn)了一個(gè)問題:我只勾選了一些零食啊,商城怎么還有其它類型的商品?我思索了一下就明白了,這網(wǎng)站還是挺流氓的,還摻雜著其他人的推廣鏈接,我一想這樣不行,轉(zhuǎn)化率肯定低啊。果不其然,試用了一天就只有5個(gè)單子,因?yàn)楣镜木W(wǎng)站還是挺有流量的,所以這轉(zhuǎn)化率不可能這么低。老板看了一下,覺得沒什么用讓我把商城入口給關(guān)了,我只好照做,但是我心里對(duì)這流氓網(wǎng)站不服啊,于是我打算自己做一個(gè)導(dǎo)購網(wǎng)站。(最后還是要敲代碼(。?_?)/~~~)
1. 安裝xlrd
cmd窗口: pip install xlrd
2.創(chuàng)建index.py,導(dǎo)入模塊
import xlrd
3.打開Excel文件讀取數(shù)據(jù)
wb=xlrd.open_workbook('文件路徑')
4.獲取表格
sheet1=wb.sheet_by_index(0) #這里的excel文檔內(nèi)只有一個(gè)表格,0代表第一個(gè)
5.獲取表格的行數(shù)
rows=sheet1.nrows
6.獲取表格中的類目
商品一級(jí)類目
住宅家具
影音電器
影音電器
美容護(hù)膚
廚房電器
運(yùn)動(dòng)服/休閑服裝
餐飲具
category0=sheet1.col_values(4) #獲取列內(nèi)容(類目),這里excel文檔的第四列是類目 del category0[0] #刪除列表中的 "商品一級(jí)類目" category=sorted(set(category0),key=category0.index) #類目列表->去除重復(fù)
7.整理數(shù)據(jù)
[ [ 分類名, [商品信息] ], [ 分類名, [商品信息] ] ] data=[] for i,v in enumerate(category): data.append([v,[]]) for i,v in enumerate(data): for x in range(rows): if v[0]==sheet1.cell(x,4).value: data[i][1].append(sheet1.row_values(x))
8.導(dǎo)出json文件
jsonData=json.dumps(data, ensure_ascii=False) with open('results.json', 'w',encoding="utf-8") as f: f.write(jsonData)
9.運(yùn)行index.py,獲得json文件
cmd窗口:python index.py
10.創(chuàng)建html頁面,并引用json文件
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script>//引用jquery $(function(){ function color16(){//十六進(jìn)制顏色隨機(jī) var r=Math.floor(Math.random()*256); var g=Math.floor(Math.random()*256); var b=Math.floor(Math.random()*256); var color='#'+r.toString(16)+g.toString(16)+b.toString(16); return color; } var navo='';//類目導(dǎo)航 var info='';//商品內(nèi)容 $.get('./results.json', function(data) {//請(qǐng)求json文件 $.each(data, function(index, val) { navo+="<a href='#"+val[0]+"''>"+val[0]+"</a> " });//把json文件中的類目數(shù)組遍歷出來,并用錨定位 $.each(data, function(index, val) { var div_title="<div id='"+val[0]+"' style='float:left;'>"; var div_content=""; $.each(val[1], function(index, val) { div_content+="<div style='background:"+color16()+"' onclick=\"location.href=\'"+val[21]+"\'\" class='pro_img'>"+val[1]+"<span class='money'>¥"+val[6]+"</span><\/div>" }); var div_footer="</div><br>"; info+=div_title+div_content+div_footer }); $('#nav').html(navo);//把導(dǎo)航顯示出來 $('#content').html(info);//把商品顯示出來 },'json'); }) </script> <style> #content{ margin-top: 10px } .money{ position: absolute; left: 0; bottom: 0; height: 30px; line-height: 30px; color: #e22a40; font-weight: 700 } .pro_img{ position: relative; float: left; width: 220px; height: 220px; line-height: 220px; text-align: center; border: 1px solid #eee; cursor: pointer; font-size: 30px; white-space:normal; overflow:hidden; /*超過部分不顯示*/ text-overflow:ellipsis; /*超過部分用點(diǎn)點(diǎn)表示*/ white-space:nowrap;*//*不換行 } </style> </head> <body> <div id="nav"></div> <div id="content"></div> </body> </html>
https://fjxasdf.github.io/daogou (github比較卡)
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。