Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to treat an empty row as nothing 1

Status
Not open for further replies.

davejackson

Technical User
May 8, 2001
34
GB
Hi,
I'm outputting html from custom tags using style sheets. Sometimes the row will be empty and I'd like the output to appear as if there is no row there at all. No matter how I change the border, margins etc., the empty table row still takes up some space on the page. Is it possible to eliminate this?
(Unfortunately I can't put the <tr> tag within the custom tag and chose not to output it as there may be a number of tags used in conjunction with each other outputting to the same row).
Thanks,
Dave
 
You can hide or remove it using Javascript DOM... This may need to be altered depending on what you mean when you say &quot;Sometimes the row will be empty&quot;. If it still has TDs that are empty, let me know and I can alter it for that situation...

<script>
function hideRows(){
allRows = document.getELementsByTagName(&quot;tr&quot;)
for (x=0; x< allRows.length; x++){
if (allRows[x].innerHTML == &quot;&quot;){
allRows[x].style.display = &quot;none&quot;
}
}
}
</script>
<body onLoad=&quot;hideRows()&quot;>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top