/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Table shows with border even though border is set to 0

Hi guys. I’m puzzled by this one. I’m creating a table using the DOM. Border is set to 0 but it looks “broken up” on IE or as if it had a border (looks fine on FF and Netscape).

You can view the table here: [url]http://home.earthlink.net/~andre.munoz/tmp6.html[/url]

This is a stripped down version of the actual project I’m working on but it’s the part I’m having issues with.

I can’t seem to figure out why it looks like that in IE. I’d appreciate it any input you can offer.

I’ll post the source code here also, just in case…

[CODE]<html>
<head>
<title>test</title>
<script language=”javaScript”>
<!–

var font_family = “Arial”;
var font_size = 13;
var heading_font_size = 14;
var heading_color = “white”;

function createTable()
{
if( document.getElementById && document.createElement )
{
// Declare variables and create the header and body of the table.
var tableContainer = document.getElementById(“oTableContainer”);
var oTable = document.createElement(“table”);
var oTHead = document.createElement(“thead”);
var oTBody = document.createElement(“tbody”);
var oRow, oCell, oText, oBR;
var i, j;

oTable.setAttribute(“id”,”bidsTable”);
oTable.setAttribute(“border”,”0″);
oTable.setAttribute(“cellspacing”,”0″);
oTable.setAttribute(“cellpadding”,”2″);
oTable.setAttribute(“width”,”580″);

oTable.appendChild(oTHead);
oTable.appendChild(oTBody);

oTHead.id = “bidsTableHead”;
oTBody.id = “bidsTableBody”;

// Insert a row into the header.
oRow = document.createElement(“tr”);
oRow.bgColor = “lightskyblue”;
oRow.noWrap = true;
oTHead.appendChild(oRow);

// customer
oCell = document.createElement(“td”);
oText = document.createTextNode(‘CUST’);
oCell.appendChild( oText );
oRow.appendChild(oCell);

// username
oCell = document.createElement(“td”);
oText = document.createTextNode(‘USERNAME’);
oCell.appendChild( oText );
oRow.appendChild(oCell);

// comment
oCell = document.createElement(“td”);
oText = document.createTextNode(‘CMT’);
oCell.appendChild( oText );
oRow.appendChild(oCell);

// time
oCell = document.createElement(“td”);
oText = document.createTextNode(‘TIME’);
oCell.appendChild( oText );
oRow.appendChild(oCell);

// Insert the table into the document tree.
tableContainer.appendChild(oTable);
}
}

//–>
</script>
</head>
<body onLoad=”javascript:createTable();”>

<!– Placeholder for the table //–>
<div id=”oTableContainer”></div>

</body>
</html>[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisAug 02.2006 — Apparently IE is sensitive to capitalization on those attributes. Go figure. Instead of oTable.setAttribute("cellspacing",0);
oTable.setAttribute("cellpadding",0);
use oTable.setAttribute("cell[color=red]S[/color]pacing",0);
oTable.setAttribute("cell[color=red]P[/color]adding",0);
Copy linkTweet thisAlerts:
@coolvirusauthorAug 02.2006 — Dude...you are da man! I knew it must have been something dumb like that.

Thanks!
×

Success!

Help @coolvirus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...