473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

setting column width using javascript

hi i am having the following code which works in firefox ,but not in iE can any on e tell me where i am going wrong?
i have to get the scrollbar in explorer as in firefox
<html>
<style>
#newdiv
{
width:300px;
height:100px;
overflow:auto;
}
</style>

<script type="text/javascript">
funtion callme()
{
var mytable = document.getElementById("newtable");
var myrow = mytable.insertRow(-1);
for (var i=0;i<10;i++)
{
var mytd = myrow.insertCell(i);
mytd.setAttribute("width",100);
mytd.setAttribute("nowrap",true);
mytd.innerHTML = "vijay";
}
}
</script>
<table>
<tr><td>
<div id="newdiv">
<table id="newtable">
</table>
</div>
</td></tr>
<tr><td>
<input type="button" value="generate divtable " onclick="callme()">
</td></tr>
</table>
</html>
May 23 '07 #1
1 1509
acoder
16,027 Expert Mod 8TB
Moved from the Articles section.
May 23 '07 #2

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

Similar topics

5
by: Laura | last post by:
Hello, Newbie question: Does anyone know how to dynamically set the screen width in an applet? I have an applet that creates a horizontal bar menu on a webpage, and I would like the width to be...
1
by: relaxedrob | last post by:
Howdy All! I am really stuck with this one - I want to completely create a table within JavaScript and insert it into the document, with onMouseOut and onMouseOver handlers in the table rows. ...
2
by: Tim Nelson | last post by:
I thought there should be simple way of setting the column width in the a DataGrid. I've set up a table style (properties tab) that lengthen the columns, but I can't seem to bind this table style...
0
by: cedoucette | last post by:
I just wrote code to support sortable columns in a datagrid. It seems to work fine; but, it doesn't look right. The problem is that I have a generic style for links and a different style for the...
6
by: cr113 | last post by:
I'm trying to set the column widths for a datagrid. You'd think it would be easy. I looked it up in google and the first thing I found looked promising: datagrid1.columns(0).width = 2000...
5
by: gesres | last post by:
I have some column headings whose widths are set via styles: <TR> <TD style="visibility:hidden;width:0px">&nbsp;</TD> <TD style="visibility:hidden;width:0px">&nbsp;</TD> <TD...
2
by: Jacksm | last post by:
How can I align an asp:table columns with gridview columns (the widths)? I have tried setting table.column(0).width = gridview.column(0).width at page_load but it doesn't work. Thanks in advance
1
by: AR123 | last post by:
Hi I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in...
7
by: Tim Ward | last post by:
Where col is a <colelement: col.style.width = "27px"; works fine on Firefox but not on IE. How do you set a column width in IE? (If it matters, the <colis not one that was present in HTML, it...
3
by: Annette Block | last post by:
I'm rather new in JavaScript, but I have some experience in php. I learned it's rather easy to open a window of a specified size with JavaScript, that you need to specify the opened file, but I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.