This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes dynamically change the width of table cell(td) thorough java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "dynamically change the width of table cell(td) thorough java script" Watch "dynamically change the width of table cell(td) thorough java script" New topic
Author

dynamically change the width of table cell(td) thorough java script

fahad nizamani
Greenhorn

Joined: Nov 19, 2011
Posts: 7
hi all,

can any one help me, i am generating table rows and table data(cell) dynamically on through java script.
i am unable to change the width of newly created table cell.i have created the cells through insert Cell() function
i tried like this,,

var oCell = new Row.insert Cell(0);
oCell.style.width="2%;"
oCell.innerHTML = "<input type='text' name='name1'>";

but style.width did not work so please any one do me favor. keep in mind i am restricted to use fire fox.


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
First thing is you have the semicolon in the wrong place



should be



Second, if the contents is bigger, the cell will expand to fit it.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamically change the width of table cell(td) thorough java script