PDA

View Full Version : [RESOLVED] Why won't IE draw the left borders?


jimgalloway@bea
12-15-2008, 07:55 PM
Can someone explain why IE will draw the borders around the table cells, but will not draw the border-left?


<script type="text/javascript">
function load() {
var table = document.getElementById("anc");
if (table != null)
{
table.cellSpacing="0";
table.cellPadding="0";
table.fontSize=".9em";
var rows = table.getElementsByTagName("tr");
var rowCount = rows.length;
for (i = 0; i < rows.length; i++) {
var cells = rows[i].getElementsByTagName("td");
for (j = 0; j < cells.length; j++) {
var text = cells[j].innerHTML;
if (text != "" && text != " " && text != "\n") { //j != cells.length-1) {
cells[j].style.borderColor="black";
cells[j].style.borderWidth="1px";
cells[j].style.borderStyle="solid";
}
}
}
var col = 1;
var between = false;
while (col < 4) {
for (i = 0; i < rows.length; i++) {
cells = rows[i].getElementsByTagName("td");
if (cells.length > col) {
text = cells[col].innerHTML;
if (text != "" && text != " " && text != "\n") between = !between;
else if (between) {
cells[col].style.borderLeftColor="black";
cells[col].style.borderLeftWidth="1px";
cells[col].style.borderLeftStyle="solid";
}
}
}
col++;
}
}
}
</script>


Works fine in Firefox, Opera and Safari, but not IE.

rangana
12-15-2008, 10:46 PM
Could you please show the markups you're using. Works fine at my end.

jimgalloway@bea
12-16-2008, 07:29 AM
I've put up a page temporarily:

...and removed it.

jimgalloway@bea
12-16-2008, 01:39 PM
Okay, figured out what was wrong. IE won't draw the border on an empty td, insert &nbsp; and it'll draw the border.

rangana
12-16-2008, 11:24 PM
Glad you got it figured out Jim. I thought I leaved a response, but it seems not. My apologies.