Hi, your first problem is that browsers tend to minimize the rendering
size of empty TRs. So instead of using:
$(".sub-section-row").filter(":contains(removeText)").text("");
try inserting space " " (or " "):
$("tr.sub-section-row td").filter(":contains(removeText)").text("
");
As you can see, I altered your jQuery to get TD (selecting table cell
that contains filtered text).
That's about it for TR removal problem. Now about increasing empty
space for notes, I think you're looking at it from the wrong corner.
Instead of trying to increase blank space and removing the containing
text at the same time, why don't you try do something about rendering
style. Best practise is to define style in your existing CSS file:
.noteForRemovedElement{
display:block;
height: 25px;
color: #FFFFFF; /* assuming that your background is white paper */
}
With .noteForRemovedElement style defined, now all you have to do is
set class .noteForRemovedElement on your filtered .sub-section-row
like this:
$(".sub-section-row
td").filter(":contains(removeText)").addClass("noteForRemovedElement");
After this, your filtered rows have markup
<tr class="sub-section-row" valign="top">
<td align="center" class="noteForRemovedElement">
<br/>
This is text I want to remove
</td>
</tr>
Only problem I can think of is that you want to print out your design
drafts, so you want to print out some kind of background image behind
text (then you would have white text (not)printed on your nice
background. To avoid that, just add .text(" "):
$(".sub-section-row
td").filter(":contains(removeText)").addClass("noteForRemovedElement").text("
");
Or in case you like it quick'n'dirty do it in one line like this:
$(".sub-section-row td").filter(":contains(removeText)").text("
").css({color:"#FFF",hieght:"25px",display:"block"});