【发布时间】:2017-05-25 20:18:45
【问题描述】:
我正在用 JavaScript 创建一个表格。
我面临的问题是最后一列的图片 使用过 display=block 和 height=10% 但是这两个图像的大小不同,并且爆炸超出了细胞的正常高度 有什么帮助吗? 图片链接:https://drive.google.com/open?id=0B-erVHxfjF5MSllSUi1UZWNKeVU
代码:
TD = document.createElement("TD");
TD.style.borderWidth="1px";
TD.style.borderStyle="none none inset none";
TD.style.borderColor="#54514e";
TD.style.textAlign="center";
/*
tForTD=document.createTextNode("submit");
*/
tForTD = document.createElement("IMG");
tForTD.setAttribute("src", "Img/submit_2.png");
tForTD.style.backgroundColor="white";
/*
tForTD.style.position="absolute";
tForTD.style.top="0%";
tForTD.style.display="block";
*/
tForTD.style.height="10%";
tForTD.style.borderRadius="50%";
tForTD.style.filter="grayscale(80%)";
tForTD.style.boxShadow="0px 1px 3px 0px black";
/*
tForTD.onclick= ( function(index) {
return function() { OnClickAddBill(index); };
} )(i);
*/
TD.appendChild(tForTD);
TR.appendChild(TD);
DBT.appendChild(TR);
【问题讨论】:
-
添加标记/代码、当前输出和预期输出。
-
请提供您的代码和您正在谈论的图像的链接。这将使您的帮助变得更加容易。
-
欢迎来到 Stack Overflow!提问前请阅读what this site is about 和“How to ask”。
-
我希望第二行和第三行的高度与标题行的高度完全相同
标签: javascript html