Forum Moderators: not2easy
<STYLE>
.outer {border: solid 2px blue; }
table.outer .inner {border: solid 10px red!important;}
</STYLE>
<table class="outer" >
<div class="inner" >
<tr>
<td colspan="1" >bla bla bla</td>
</tr>
</div>
</table>
Is there any way to overwrite this outer table tag from within?
If all you are trying to do is remove/change the border from the table why not write the style rule into the page?
Where you are putting your <div> is not corrent. You would need to put it inside a TD, even so it would not make any difference to the table border.
Call another CSS file after the initial one is called, or if you have no control over the <HEAD> of your document, write the rule directly inline:
<table class="outer" >
<tr>
<td colspan="1" >
<style type="text/css">
table.outer {
border: none;
}
</style>
bla bla bla</td>
</tr>
</table>
This is not the most elegant way of doing this, but if you have absolutely no control over the CSS files or access to anything other than inside the table, it may be your only solution.
HTH
(Just for some additional background, this is for changing the border colors of individual portlets. The portal software only has one type of "outer" tag, and this is automatically inserted. Any global change would affect all porlets rather than just the ones in question.)
You could wrap the table in a <div class="wrapperDiv"> and then in the CSS:
div.wrapperDiv table.outer {
border: none;
}
That may be the easist way? Can you wrap this table in a Div?
The W3C CSS adjacent selectors [w3.org] documentation is an invaluable resource...
So, in your HTML:
<table class="outer">
<tbody id="controlElement">
<tr>
...
</tr>
</TBODY>
</table>
And then the script:
<script type="text/javascript">
function doIt(theElement) {
document.getElementById(theElement).parentNode.style.border = 'none';
}doIt('controlElement');
</script>
Runningthe doIt function should happen in the <body> of the page (it can be in a cell of the table).
HTH