Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > borderStyle = "none" leaves blank spaces

Reply
Thread Tools

borderStyle = "none" leaves blank spaces

 
 
spifster
Guest
Posts: n/a
 
      06-05-2006
Hello all,

I am building a collapsable tree using Javascript with DOM in IE. In
order to make collapsed cells disappear I have been hiding the text.
The cells collapse but still leave borders behind. I have set the
borderStyle to none and the black lines go away, but there is still
white space where the borders were. Following are my html files I am
using to test it.

----------------BEGIN HTML FILE----------------

<SCRIPT LANGUAGE="Javascript">
function hide()
{
document.getElementById("td2").style.borderStyle = "none";
document.getElementById("td3").style.borderStyle = "none";
document.getElementById("td4").style.borderStyle = "none";
document.getElementById("td5").style.borderStyle = "none";
document.getElementById("td6").style.borderStyle = "none";
document.getElementById("td7").style.borderStyle = "none";
document.getElementById("td8").style.borderStyle = "none";
document.getElementById("td9").style.borderStyle = "none";
}

function show()
{
document.getElementById("td2").style.borderStyle=" solid";
document.getElementById("td3").style.borderStyle=" solid";
document.getElementById("td4").style.borderStyle=" solid";
document.getElementById("td5").style.borderStyle=" solid";
document.getElementById("td6").style.borderStyle=" solid";
document.getElementById("td7").style.borderStyle=" solid";
document.getElementById("td8").style.borderStyle=" solid";
document.getElementById("td9").style.borderStyle=" solid";
}

</SCRIPT>

<html>


<head>
<title>Test Border</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link href="include-files/style.css" type="text/css"
rel="STYLESHEET">
</head>
<body>

<table id="tbl">
<tr id="tr1">
<td id="td1"> first table row </td>
</tr>
<tr id="tr2">
<td id="td2" > </td> <!-- style="border-width:0px;" -->
</tr>
<tr id="tr3">
<td id="td3"> </td>
</tr>
<tr id="tr4">
<td id="td4"> </td>
</tr>
<tr id="tr5">
<td id="td5"> </td>
</tr>
<tr id="tr6">
<td id="td6"> </td>
</tr>
<tr id="tr7">
<td id="td7"> </td>
</tr>
<tr id="tr8">
<td id="td8"> </td>
</tr>
<tr id="tr9">
<td id="td9"> </td>
</tr>
<tr>
<td> Blah </td>
</tr>


</table>

<input type="button" onclick="hide()" name="Hide" value="Hide">
<input type="button" onclick="show()" name="Show" value="Show">

</body>
</html>

----------------END HTML FILE----------------

----------------BEGIN CSS FILE (/include-files/style.css)-------

//a-style.css paper studios main

BODY { background-color: white}

A:link {text-decoration: none; color: 0000DD}
A:visited {text-decoration: none; color: 0000DD}
A:active {text-decoration: none}
A:hover {text-decoration: none; color: FF0000}

A.topmenu:link {text-decoration: none; color: CCFF99}
A.topmenu:visited {text-decoration: none; color:CCFF99 }
A.topmenu:active {text-decoration: none; }
A.topmenu:hover {text-decoration: none; color: CCCCFF }


P{ font: 10pt/12pt Verdana, serif }
td{ font: 10pt/12pt Verdana, serif }
caption { font: 10pt/12pt Verdana, serif }
center{font: 10pt/12pt Verdana, serif }
ul{ font: 10pt/12pt Verdana, serif }
XMP{ font: 10pt/12pt Verdana, serif }

table{border-collapse: collapse;}
td{border-width:1px; border-color:black; border-collapse:
seperate;border-style:solid;}

table.allstuff{border-collapse: collapse;}
td.white{border-width:1px; border-color:white; border-collapse:
collapse;border-style:solid;}

td.group{background:4972A3; color:white; border-width:1px;
border-color:black; border-collapse: collapse;border-style:solid;}
tr.heading{background:99cccc;}
td.blank{border-width:0px; }
td.bringDown{border-collapse: collapse; border-width: 1px;
border-color:gray;}
td.bringDown2{border-collapse: collapse; border-width: 0px;}
tr.bringDown{border-collapse: collapse; border-width: 0px;}

p.margin {margin: 4px 4px 4px 4px}

table.adds {border-color:gray; border-width:1px;
border-collapse:collapse;}
td.written {border-color:gray; border-width:1px;
border-collapse:collapse;}
tr.filled {border-color:gray; border-width:1px;
border-collapse:collapse;}
// main

----------------END CSS FILE----------------

Try these to demo what I am seeing.

I want the table rows to collapse as if they are a single solid table.


Thanks in advance,

--David

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      06-05-2006
spifster wrote:
> Hello all,
>
> I am building a collapsable tree using Javascript with DOM in IE. In
> order to make collapsed cells disappear I have been hiding the text.
> The cells collapse but still leave borders behind. I have set the
> borderStyle to none and the black lines go away, but there is still
> white space where the borders were. Following are my html files I am
> using to test it.
>

Have you tried setting borderCollapse and/or borderSpacing?

You are probably better of using two css styles and sapping between
them, it's easier than mucking about with style attributes.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
spifster
Guest
Posts: n/a
 
      06-07-2006
Yeah, I am using border-collapse and have had no luck with
border-spacing. Thanks for the css comment, I will do that. Other
than that I am still open for suggestions.

Ian Collins wrote:
> spifster wrote:
> > Hello all,
> >
> > I am building a collapsable tree using Javascript with DOM in IE. In
> > order to make collapsed cells disappear I have been hiding the text.
> > The cells collapse but still leave borders behind. I have set the
> > borderStyle to none and the black lines go away, but there is still
> > white space where the borders were. Following are my html files I am
> > using to test it.
> >

> Have you tried setting borderCollapse and/or borderSpacing?
>
> You are probably better of using two css styles and sapping between
> them, it's easier than mucking about with style attributes.
>
> --
> Ian Collins.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid - BorderStyle="None" and BorderWidth="None" doesn't work for Firefox David Freeman ASP .Net 8 02-16-2011 11:03 AM
Headerstyle's borderstyle not working in datagrid. archana ASP .Net 2 04-13-2007 01:13 PM
Precompile leaves a blank folder =?Utf-8?B?U2hpcHN0ZXI=?= ASP .Net 2 01-29-2007 09:15 PM
Printing ASP.NET 2.0 Page Leaves Blank Areas =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==?= ASP .Net 2 11-10-2006 09:28 PM
BorderStyle on ComboBoxes Craig G ASP .Net 0 02-22-2005 11:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57