


先上效果图:
CSS:
body{margin:0px;padding:0px;-moz-user-select:none;cursor:default;}
.tabEditDiv{position:absolute;width:15px;height:15px;cursor:pointer;}
.seltab{position:absolute;width:15px;height:15px;cursor:pointer;background:url(images/seltab.gif) no-repeat;}
.splitx{overflow:hidden;position:absolute;height:3px;cursor:row-resize;background:red !important;filter:Alpha(opacity=10);-moz-opacity:0.1;opacity: 0.1; }
.splity{overflow:hidden;position:absolute;width:3px;cursor:col-resize;background:red !important;filter:Alpha(opacity=10);-moz-opacity:0.1;opacity: 0.1;}
#tabletitle{font-weight:bold;font-size:18px;height:30px;width:800px;margin:0 auto;text-align:center;font-family:宋体;line-height:30px;}
#tabletitle input{width:100%;border:0px;height:28px;line-height:30px;text-align:center;font-weight:bold;font-size:18px;font-family:宋体;}
.finelinetable{border-right:1px solid #000;border-top:1px solid #000;border-collapse:collapse;font-size:13px;width:800px;margin:0 auto;}
.finelinetable td{border-left:1px solid #000;border-bottom:1px solid #000;height:25px;}
HTML:
1 | |||||||
2 | 3 | 4 | 5 | 6 | 7 | ||
8 | 9 | 10 | 11 | 12 | 13 | ||
14 | 15 | 16 | 17 | 18 | |||
JS:
//Note: Get the object. Example: $("objectId") is equivalent to document.getElementById("objectId")
if (typeof $ != "function") { var $ = function ( ids) { return document.getElementById(ids) }; }
//Note: Get the coordinates, the last node of parentNode. Example: absPos(object).x
function absPos(_node, parentNode) { var x = y = 0; var node = _node; do { if (parentNode && node == parentNode) { break; } x = node.offsetLeft; y = node.offsetTop; } while (node = node.offsetParent); node = _node; return { 'x': x, 'y': y }; }
function addEvent(object, event, func) { if (object.addEventListener) { /* W3C method (DOM method) The meaning of false in the following statement is It is used in the bubbling phase. If it is true, it is used in the capturing phase (IE does not support capturing), so false is used here for the purpose of unification. */object.addEventListener(event, func, false); return true; } else if (object.attachEvent) { /* MSIE method (IE method) */object['e' event func] = func; object[event func] = function () { object['e' event func](window. event); }; object.attachEvent('on' event, object[event func]); return true; } /*If neither method is available, return false */return false; }
//Comments: Determine whether onmouseover and onmouseout are triggered by child nodes within the object. Example: e = e || event;if (isMouseLeaveOrEnter(e, obj)) {}
function isMouseLeaveOrEnter(e, handler) { if (e.type != 'mouseout' && e.type != 'mouseover') return false; var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement; while (reltg && reltg ! = handler) reltg = reltg.parentNode; return (reltg != handler); }
var table = $("mainTable");
var tabEditDiv; //DIV covering the table
var cellHide = [];//Supplementary rowspan, cellspan grid
var moveMode = "";//Mouse movement mode
var moveArgs = []; //Move mode parameters
document.onselectstart = function(){return false;};
addEvent(window,"resize",function(){loadTable();});
$("tabletitle").ondblclick = function(){
if(this.getElementsByTagName("input").length > 0){return;}
this.innerHTML = "";
var input = this.getElementsByTagName("input")[0];
var _this = this;
input.focus();
input.onblur = function(){_this.innerHTML = this.value;}
input.onkeydown = function (e) { var key = window.event ? window.event. keyCode : e.which; if (key == 13) this.blur(); };
}
function loadTable(){
var tabPos = absPos(table);
if(!tabEditDiv){
tabEditDiv = document.createElement("div");
document.body.appendChild(tabEditDiv); tabPos.x - 15) "px;top:" (tabPos.y - 15) "px;";
tabEditDiv.className = "tabEditDiv";
//Select all Table button
if(!seltab){
var seltab = document.createElement("div");
seltab.style.cssText = "width:15px;height:15px;left:" (tabPos.x - 15) " px;top:" (tabPos.y - 15) "px;";
seltab.className = "seltab";
seltab.onclick = function(){
if(table.getAttribute("selected ") == "1"){
table.removeAttribute("selected");
table.style.background = "";
this.style.width = "15px";
This .style.height = "15px";
else{
table.setAttribute("selected","1");
table.style.background = "#B6CAEB";
this.style.width = (table.clientWidth 15) "px";
this.style.height = (table.clientHeight 15) "px";
}
}
document.body.appendChild(seltab);
}
loadTableEdit();
} loadTable();
function loadTableEdit(){ //加载可调整宽度及高度的div
var tabPos = absPos(table);
tabEditDiv.innerHTML = "";
var cellcount = 0;
var isadd = cellHide.length == 0;
for(var i=0;i
if(!$("splitx_" (pos.y table.rows[i].cells[j].clientHeight))){ //加载可调整高度的div
var split = document.createElement("div");
split.id = "splitx_" (pos.y table.rows[i].cells[j].clientHeight);
split.className = "splitx";
split.style.cssText = "width:" table.clientWidth "px;left:15px;top:" (pos.y table.rows[i].cells[j].clientHeight - 1 15) "px";
split.onmousedown = function(){
var index = this.getAttribute("index");
if(index == null){ index = 0; var divs = tabEditDiv.getElementsByTagName("div"); var left = parseInt(this.id.split("_")[1]); for(var k=0;k
moveArgs[moveArgs.length] = index;
}
tabEditDiv.appendChild(split);
}
if(j > 0){ //加载可调整宽度的div
if(!$("splity_" pos.x)){
var split = document.createElement("div");
split.id = "splity_" pos.x;
split.className = "splity";
split.style.cssText = "height:" table.clientHeight "px;top:15px;left:" (pos.x - 2 15) "px";
split.onmousedown = function(){
var index = this.getAttribute("index");
if(index == null){ index = 0; var divs = tabEditDiv.getElementsByTagName("div"); var left = parseInt(this.id.split("_")[1]); for(var k=0;k
moveArgs[moveArgs.length] = index;
}
tabEditDiv.appendChild(split);
}
}
if(isadd){
loadHide();
}
table.rows[i].cells[j].onmousedown = function(){
//alert("x");
}
}
}
}
function loadHide(){
cellHide = [];
var tempHide = [];
for(var i=0;i
tempHide[tempHide.length] = [i k,j];
}
}
}
for(var i=0;i
for(var l=0;l
for(var l=0;l
}
cellHide[cellHide.length] = [i,j k yc];
}
}
}
}
addEvent(document,"mousemove",function(e){
e = e || window.event;
if(moveMode == "cellWidth"){ //调整宽度
var temp = moveArgs[0];
var test = "";
for(var i=0;i
for(var j=0;j
}
if(!table.rows[i].cells[index] || index 1){continue;}
if(e.clientX > absPos(table.rows[i].cells[index]).x)
table.rows[i].cells[index].style.width = e.clientX - absPos(table.rows[i].cells[index]).x "px";
}
loadTableEdit();
}else if(moveMode == "cellHeight"){ //调整高度
var index = moveArgs[0];
for(var i=0;i
if(e.clientY > absPos(table.rows[index].cells[i]).y)
table.rows[index].cells[i].style.height = e.clientY - absPos(table.rows[index].cells[i]).y "px";
}
loadTableEdit();
}
});
addEvent(document,"mouseup",function(e){
moveMode = ""; moveArgs = [];
});
addEvent(document,"mouseout",function(e){
e = e || event;
if (!isMouseLeaveOrEnter(e, this)) { return; }
moveMode = ""; moveArgs = [];
});

使用错误检查工具使用Excel电子表格查找错误的最快方法之一是使用错误检查工具。如果该工具发现任何错误,您可以更正它们并再次尝试保存文件。但是,该工具可能无法找到所有类型的错误。如果错误检查工具没有发现任何错误或修复它们不能解决问题,那么您需要尝试以下其他修复之一。要在Excel中使用错误检查工具:选择公式 选项卡。单击错误检查 工具。在发现错误时,有关错误原因的信息将出现在工具中。如果不需要,请修复错误或删除导致问题的公式。在错误检查工具中,单击下一步以查看下一个错误并重复该过程。当没

如何在打印预览中设置GoogleSheets打印区域Google表格允许您使用三个不同的打印区域打印电子表格。您可以选择打印整个电子表格,包括您创建的每个单独的工作表。或者,您可以选择打印单个工作表。最后,您只能打印您选择的部分单元格。这是您可以创建的最小打印区域,因为理论上您可以选择单个单元格进行打印。最简单的设置方法是使用内置的Google表格打印预览菜单。您可以在PC、Mac或Chromebook上的网络浏览器中使用Google表格查看此内容。要设置Google

不同单元格格式太多复制不了的解决办法:1、打开EXCEL文档,然后在几个单元格中输入不同格式的内容;2、在Excel页面的左上角找到“格式刷”按钮,然后单击“格式刷”选项;3、点击鼠标左键,将格式统一设置成一致的即可。

在数值上,在文本字符串上,在错误的地方使用逗号确实会变得烦人,即使对于最大的Excel极客来说也是如此。您甚至可能知道如何摆脱逗号,但您知道的方法可能对您来说很耗时。好吧,无论您的问题是什么,如果它与您的Excel工作表中的错误位置的逗号有关,我们可以告诉您一件事,您所有的问题今天都会得到解决,就在这里!深入研究这篇文章,了解如何通过尽可能简单的步骤轻松去除数字和文本值中的逗号。希望你喜欢阅读。哦,别忘了告诉我们哪种方法最吸引你的眼球!第1节:如何从数值中删除逗号当数值包含逗号时,可能有两种情

如何在Windows上的Excel中查找合并的单元格在从数据中删除合并的单元格之前,您需要全部找到它们。使用Excel的查找和替换工具很容易做到这一点。在Excel中查找合并的单元格:突出显示要在其中查找合并单元格的单元格。要选择所有单元格,请单击电子表格左上角的空白区域或按Ctrl+A。单击主页选项卡。单击查找和选择图标。选择查找。单击选项按钮。在FindWhat设置的末尾,单击Format。在对齐选项卡下,单击合并单元格。它应该包含一个复选标记而不是一行。单击确定以确认格式

如何在Windows11上创建自定义电源计划自定义电源计划允许您确定Windows如何对不同情况作出反应。例如,如果您希望显示器在一段时间后关闭,但又不想让它进入睡眠状态,您可以创建一个自定义计划来执行此操作。在Windows11上创建自定义电源计划:打开开始菜单并键入控制面板。从搜索结果中选择控制面板。在控制面板中,将查看方式选项更改为大图标。接下来,选择电源选项。单击电源选项菜单中的创建电源计划选项。从提供的选项中选择您要使用的基本电源计划。在底部的计划名称字段中为其指定一个描述性名

如果您的任务是处理包含大量日期的电子表格,那么计算多个日期之间的差异可能会非常令人沮丧。虽然最简单的选择是依靠在线日期计算器,但它可能不是最方便的,因为您可能必须将日期一一输入到在线工具中,然后手动将结果复制到电子表格中。 对于大量日期,您需要一个更方便地完成工作的工具。幸运的是,谷歌表格允许用户在本地计算电子表格中两个日期之间的差异。在这篇文章中,我们将使用一些内置函数帮助您计算Google表格上两个日期之间的天数。 如何计算Google表格上的日期之间的差异如果您希望Google

如何使用 RANDBETWEEN 在 Excel 中生成随机数如果要生成特定范围内的随机数,RANDBETWEEN 函数是一种快速简便的方法。这允许您在您选择的任何两个值之间生成随机整数。使用 RANDBETWEEN 在 Excel 中生成随机数:单击您希望出现第一个随机数的单元格。键入=RANDBETWEEN(1,500)将“1”替换为您要生成的最低随机数,将“500”替换为


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
