Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在可滚动表中保留动态添加的行_Javascript_Css - Fatal编程技术网

Javascript 如何在可滚动表中保留动态添加的行

Javascript 如何在可滚动表中保留动态添加的行,javascript,css,Javascript,Css,函数addField(参数){ var myTable=document.getElementById(“myTable”); var currentIndex=myTable.rows.length; var currentRow=myTable.insertRow(-1); var linksBox=document.createElement(“文本”); setAttribute(“名称”、“链接”+currentIndex); var关键字box=document.createElem

函数addField(参数){
var myTable=document.getElementById(“myTable”);
var currentIndex=myTable.rows.length;
var currentRow=myTable.insertRow(-1);
var linksBox=document.createElement(“文本”);
setAttribute(“名称”、“链接”+currentIndex);
var关键字box=document.createElement(“输入”);
关键字box.setAttribute(“名称”、“关键字”+currentIndex);
var violationsBox=document.createElement(“输入”);
setAttribute(“名称”、“violationtype”+currentIndex);
var currentCell=currentRow.insertCell(-1);
currentCell.appendChild(linksBox);
currentCell=currentRow.insertCell(-1);
currentCell.appendChild(关键字框);
currentCell=currentRow.insertCell(-1);
currentCell.appendChild(violationsBox);
}

升级

您需要在表格上添加一个
显示:块
,使其可滚动:

函数addField(参数){
var myTable=document.getElementById(“myTable”);
var currentIndex=myTable.rows.length;
var currentRow=myTable.insertRow(-1);
var linksBox=document.createElement(“文本”);
setAttribute(“名称”、“链接”+currentIndex);
var关键字box=document.createElement(“输入”);
关键字box.setAttribute(“名称”、“关键字”+currentIndex);
var violationsBox=document.createElement(“输入”);
setAttribute(“名称”、“violationtype”+currentIndex);
var currentCell=currentRow.insertCell(-1);
currentCell.appendChild(linksBox);
currentCell=currentRow.insertCell(-1);
currentCell.appendChild(关键字框);
currentCell=currentRow.insertCell(-1);
currentCell.appendChild(violationsBox);
}

升级

你累了吗最大高度:50px?