I have a WYSIWYG editor inside of a table that is placed within a div, as such…
<div class="mydiv">
<li>
<table>My WYSIWYG</table>
</li>
</table>
Inside my WYSIWYG there are more tables however I only want to target the first table, I understand I could assign a class to the table but thats not what I want.
I’ve tried using the following only it doesn’t seem to work…
.mydiv li + table {width:100%;}
You need
.mydiv li table:first-child.More information.
:first-childworks in IE7+ and all modern browsers.An example.
.mydiv li + tableisn’t working for you because that matches something like this:Also note that there are few things wrong with your HTML:
</table>at the end should be</div>.divshould be aul, becauseliis not a valid child ofdiv.I’ve fixed these things in the demo above.