mgason Posted May 3, 2011 Share Posted May 3, 2011 Hi,I am trying to target a td in a page that is created by a cms.I can not just remove it as I don't have acces to those files.I would like to hide or collapse it.How do I write a rule for a td that has a name? eg a named div rule starts #myDivName{ ;}I want to collapse td leftTD.The html is <body><table cellpadding="0" cellspacing="0" width="100%" id="mainTable"> <tbody><tr valign="top"> <td id="leftTD"> <div id="leftColumnDiv"> Another related question when setting visibilty:hidden or display:none on a div, should it hide any content in the div, such as other divs, or images.Right now that does not seem to be the case but the problem could be something else.ThanksMark Link to comment Share on other sites More sharing options...
Synook Posted May 3, 2011 Share Posted May 3, 2011 CSS isn't just for divisions, the selectors will work for all elements. Try it! Link to comment Share on other sites More sharing options...
mgason Posted May 3, 2011 Author Share Posted May 3, 2011 sorted it is #tdNameI was thinking it was not working, my div was actually ctl00_rightTDI thought it was ct100, it is ctL00!small print, should have tried my glasses ;-) Link to comment Share on other sites More sharing options...
dsonesuk Posted May 3, 2011 Share Posted May 3, 2011 The problem with targetting a td to hide or remove, is that you may affect the layout of the table itself, it has lost a cell, so other rows using colspan, may now span the next cell you have hidden/removed. It would e better to target the element within it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.