473,804 Members | 3,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table creation with cell spacing of 0 on IE

I'm trying to build a table using DOM methods with script that follows
this type of format:

// note the var bodyEl is predefined as the body element
//
var mytable = document.create Element("TABLE" );
var mytablebody = document.create Element("TBODY" );
// First row
var mycurrent_row = document.create Element("TR");
var mycurrent_cell = document.create Element("TD");
var currenttext = document.create TextNode("Some text here.");
// append everything
mycurrent_cell. appendChild(cur renttext);
mycurrent_row.a ppendChild(mycu rrent_cell);
mytablebody.app endChild(mycurr ent_row);
mytable.appendC hild(mytablebod y);
bodyEl.appendCh ild(mytable);

This is working except that I've styled the table with one colour border
and the cell with a different colour border and I want the two borders
to abut.

With FF I just set border-spacing to 0 but IE doesn't support this CSS
property. So I need to go back to the old cellspacing attribute.

My problem is that I can't seem to 'attach' it to the table. I've tried
the following to no avail:
mytable.cellspa cing = "0";
mytable.setAttr ibute("cellspac ing ", "0" );

Is there some way to do this?

Andrew Poulos

Jul 23 '05 #1
1 1849


Andrew Poulos wrote:

My problem is that I can't seem to 'attach' it to the table. I've tried
the following to no avail:
mytable.cellspa cing = "0";
mytable.setAttr ibute("cellspac ing ", "0" );


Watch out for the case, it is cellSpacing
mytable.cellSpa cing = "0"
<http://msdn.microsoft. com/library/default.asp?url =/workshop/author/dhtml/reference/properties/cellspacing.asp >
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-68907883>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
39123
by: Rick DeBay | last post by:
I'm trying to create a layout table, where the spacing between rows varies. I've tried using setting margin-top and border-top for the rows I wan't spaced down from the one above, and I've also tried setting it on all of the cells of that row. This hasn't worked, so I was wondering if anyone knew how it could be done. Thanks, Rick DeBay
19
17595
by: CMAR | last post by:
I have the following markup. The problem is that the browser, e.g., IE6, inserts several lines of blank space between the <div> and the following table. Is there a way to minimize that vertical spacing? Thanks, CMA <div class="vlgray">Condition</div> <table cellpadding="0" cellspacing="0">
0
2735
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there anyway to stop this...??? <HTML> <HEAD> <title>Conform Inbox</title> <meta content="False" name="vs_snapToGrid">
0
1516
by: Thomas Scheiderich | last post by:
I have a table that has 3 image slices. The middle slice changes size based on size of browser window. This works great. My client wants the date to show over the image on the right. So what I did was cut off the top part of the image (which is just a solid color and I can handle by making the background-color of the cell this color). I then use a asp line to display the date, which also works. Here is the original table setup for...
7
1342
by: Ryan | last post by:
I am not a web programmer and trying to figure out the best way for laying out a form for data entry. I would like, for example, to have a right justified label followed by 5 pixals and a left justified textbox. Should I use three columns for this, with the center column five pixals wide or two colums with the table cell spacing set to five pixals. Also, when is it appropriate to use the lable control as opposed to just keying text into...
3
2096
by: Selden McCabe | last post by:
Sometimes I want to put a table inside a cell of another table (say, to create 3 equal divisions, etc.). When I want the inner table's edges to correspond exactly with the edges of the cell, I set the border (top, left, bottom, right) to zero for both the inner table and outer table. Also padding to 0 and spacing to 0. But, for some reason, there is still some space between the bottom of the inner table and the bottom of the containing...
2
8061
by: tradmusic.com | last post by:
Hi, I'm having problems specifying 0 for cell spacing and cell padding using CSS...I've got: #Table { width: 730px; padding: 0; }
16
3243
by: Barbara de Zoete | last post by:
Here's what I'm trying to do: Create a table with generic style property . Have a few table cells in the thead that 'have to' melt into eachother, so needing the style . Looking somthing like: ,------------.------------. | | header |
10
11057
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way to do that in CSS without having to code in extra dummy columns in HTML to create gutters? -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ ...
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.