• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Blank Line inserting in a table,when rows are added dynamically.can anyone help?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have placed <div> within the <td> of the main table.
In the <div> i have a table, to which the rows are added dynamically.
when the rows are added , blank line is inserting in the <td> of the main table.

I have tried with style="display-inline;padding:0px". it dint work.
Can any one please suggest some solution.



Thanks in advance
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you are using java script or iterating list using java.
 
isabella swan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pawan Kr Gupta wrote:you are using java script or iterating list using java.



am using javascript
 
Pawan Kr Gupta
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please refer the below code

function addRow()
{

var tbody = document.getElementById("table1").getElementsByTagName("tbody")[0];
var row = document.createElement("TR");
var cell1 = document.createElement("TD");
var cell2 = document.createElement("TD");
var cell3 = document.createElement("TD");
cell3.setAttribute("align","right");
var cell4 = document.createElement("TD");
cell4.setAttribute("align","right");
var cell5 = document.createElement("TD");
var cell6 = document.createElement("TD");
cell6.setAttribute("align","right");
var cell7 = document.createElement("TD");
var cell8 = document.createElement("TD");
var cell9 = document.createElement("TD");
var cell10 = document.createElement("TD");

cell1.innerHTML = "<td><input type=RADIO name=checkBoxTest onclick=modifynRemove(this,"+gRowId+"); ></td>";
cell2.innerHTML = "<td ><input type=text name= instrumentType"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.instrumentType.options[document.SAF_CallingForm.instrumentType.selectedIndex].text+"\" style=border:0><input type=hidden name= hdinstrumentType"+gRowId+" value="+document.SAF_CallingForm.instrumentType.options[document.SAF_CallingForm.instrumentType.selectedIndex].value+" ></td>" ;
cell3.innerHTML = "<td ><input type=text name= chequeDDDate"+gRowId+" readonly=true tabindex=-1 value=\""+document.SAF_CallingForm.chequeDDDate.value+"\" style=border:0;text-align:center;background-color:transparent></td>" ;
cell4.innerHTML = "<td ><input type=text name= amount"+gRowId+" readonly=true tabindex=-1 value=\""+document.SAF_CallingForm.amount.value+"\" style=border:0;text-align:right;background-color:transparent><input type=hidden name= hdAmount"+gRowId+" value="+document.SAF_CallingForm.amount.value+" ></td>" ;
cell5.innerHTML = "<td ><input type=text name= lbxcashAccount"+gRowId+" readonly=true tabindex=-1 value=\""+document.SAF_CallingForm.lbxcashAccount.value+"\" style=border:0;text-align:left;background-color:transparent></td>" ;
cell6.innerHTML = "<td ><input type=text name= chequeddno"+gRowId+" readonly=true tabindex=-1 style=text-align:right;background-color:transparent value=\""+document.SAF_CallingForm.chequeddno.value+"\" style=border:0></td>" ;
cell7.innerHTML = "<td ><input type=text name= infavourof"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.infavourof.value+"\" style=border:0></td>" ;
cell8.innerHTML = "<td ><input type=text name= payableat"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.showlbxpayableat.value+"\" style=border:0><input type=hidden name= hdpayableat"+gRowId+" value="+document.SAF_CallingForm.lbxpayableat.value+" ></td>" ;
cell9.innerHTML = "<td ><input type=text name= Drawnon"+gRowId+" readonly=true tabindex=-1 style=text-align:left;width:180px;background-color:transparent value=\""+document.SAF_CallingForm.showlbxDrawnon.value+"\" style=border:0><input type=hidden name= hdDrawnon"+gRowId+" value="+document.SAF_CallingForm.lbxDrawnon.value+" ></td>" ;
cell10.innerHTML = "<td ><input type=text name= reason"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.reason.value+"\" style=border:0></td>" ;

row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
row.appendChild(cell4);
row.appendChild(cell5);
row.appendChild(cell6);
row.appendChild(cell7);
row.appendChild(cell8);
row.appendChild(cell9);
row.appendChild(cell10);

tbody.appendChild(row);


}
 
isabella swan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for your help.

Actually i could figure out that table was moving down, when the rows are added.
I could fix wit style="position: absolute;" on the main table.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This code here:



is totally wrong.

It means your html would look like



Eric
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic