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.
<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.