By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Add Row Dynamic with Styles

P: 3
Hi I have a problem. I did this function to add a row dynamic but, I don't know how to add style, like aling="left". This is my funcion:
function addRow()
{
var i;
var myIDS = ['txtCodigo','txtDescripcion','txtCantidad'];
var newRow = document.all("grdPedido").insertRow();
if(frmPedido.txtCantidad.value > 0)
{
for(i=0;i<myIDS.length;i++)
{
var oCell = newRow.insertCell();
oCell.innerHTML = document.getElementById(myIDS[i]).value;
}
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Eliminar' click='removeRow(this);'/ id='button'1 name='button'1>";
}
}
Sep 11 '06 #1
Share this Question
Share on Google+
2 Replies


drhowarddrfine
Expert 5K+
P: 7,435
If you are asking how to add style inline then it would be style="align:right; color:red;" etc. Forgot how to do it in js.
Sep 11 '06 #2

Delerna
Expert 100+
P: 1,134
oCell.setAttribute('align','right');
Jan 16 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.