How to apply CSS to td of particular table using Classname? [duplicate]
Tags: html,css
Problem :
This question already has an answer here:
How to apply CSS to td of particular table using Classname? (Not ID or Name)
Following is HTML
<table class="pure-table ToBeApplied">
<tbody>
<tr class="pure-table-odd">
<td>
<label>Bank</label>
</td>
<td>
<label>Japha Bank</label>
</td>
</tr>
</tbody>
</table>
<table class="pure-table NotToBeApplied>
<tbody>
<tr class="pure-table-odd">
<td>
<label>Bank</label>
</td>
<td>
<label>Japha Bank</label>
</td>
</tr>
</tbody>
</table>
I want to apply CSS say
td {padding-top:0; padding-bottom:0;}
- i want to apply it on td's of table having Classname''ToBeApplied''.
- I do not want to write a class and write same on each td of table
- I do not want it to apply on td's of second table have Classname''NotToBeApplied''
How to modify HTML and CSS to achieve above?
Solution :
Try this
table.ToBeApplied tbody tr td{
padding-top:0; padding-bottom:0;
}
CSS Howto..
It can be done in a simpler and more compatible way without using javascript: HTML: <div class="show-image"> <img src="http://i.imgur.com/egeVq.png" /> <input class="the-buttons" type="button" value=" Click " /> </div> CSS: div.show-image...
Note that months are zero indexed so January is 0, February 1 and so on so December is 11. Pretty easy to fix, just add 1 to the month number...
Normal CSS does not support inheritance; you need to add the child's selector to the parent's ruleset: #edButtonHTMLChild, #edButtonHTML{ styles... } or use Javascript to apply the same styles....
dont use the jquery :D all of what you needs a container, a contained data in a varable and the tabs the container is the victim of the css changes....
No. CSS can't modify the DOM, only its presentation.
There are various hack-y ways to force re-rendering. script.aculo.us has a method called forceRerendering (naturally) that looks like this: someElement.appendChild(document.createTextNode(' ')); someElement.removeChild(someElement.lastChild); That ought to work in this case, too....
<%= link_to account_setup_path(id: :start_a_club), class: 'list-group-item' do %> <i class="fa fa-plus fa-fw hot-pink"></i> Start a club <% end %> ...
This should work on IE7/8 and other non-IE browsers. The extra 'padding/margin' to the top and/or bottom is introduced by the <p> elements. This is due to the uncollapsing margin...
Is this what you're looking for? I put the form elements into a .container div, changed .dropdown and .search-controller .form-control to display:inline-block and removed the relative positioning from .search-controller .form-control....
Have you tried padding-left: 0px? Seems to work here.
Surely your .container moves to left because you set the position: fixed and it sticks to the very left site as designed. If you want to center the Bootstrap's .container...
In your style.cssfile try adding the following and see what happends: @media print { body { border: 15px solid black; } } You have to use @media print to apply...
There is a CSS attribute for this -- it is text-overflow:ellipsis;. However, there is one problem with it: it doesn't work in Firefox. It works in all other browsers, but...
<div style="position:relative"> <img src="1.png" style="position:absolute; top:0px; left:10px; z-index:0"/> <img src="1.png" style="position:absolute; top:0px; left:20px; z-index:1"/> <img src="1.png" style="position:absolute; top:0px; left:30px; z-index:2"/> <img src="1.png"...
There's no cross-browser CSS only solution to normalizing form elements. For a non-JS solution that works in modern browsers, check out this CSS ninja article. Otherwise, your best option is...
You could add the CSS declarations within a class and add/remove the class to the parent element of the radio buttons, as follows: .checked { box-shadow: 0 0 5px #5cd053;...
Please, never do that again! The way to do it would be with floats, but you really NEVER wanna use something like that! By the way, div's aren't allowed within...
I received the answer in another thread - How to add 'if' to jQuery chain code use - .each(function() { this.style.cssText+= 'z-index: '+(parseInt($(this).css('z-index'))+1)+' !important'; }) but after struggling with the...
welcome to Stack Overflow! It would be very helpful if you filled us in on what you've tried or specifically how the ivh-treeview documentation is not clear. As one of...
<div class="col-sm-5 btn-group" data-toggle="buttons"> <label class="btn btn-info"> <input checked="checked" name="media_release" value="1" type="radio"> Yes </label> <label class="btn btn-info btn_red"> <input name="media_release" value="0" type="radio"> No </label> </div>...
If I understood you correctly you want to append a new text to every image that gets called. In order to do this I suggest you add this function and...
.widget_content { height: 150px !important; /* Or however high you want the div to be */ } This will stop the div changing heights, which I assume is what you...
I can't believe I messed this up, but yes, of course there is a way With this code: <span>How do you tell a browser,</span><span>"if you need to wrap, wrap here...
Check out Brad's answer here: http://stackoverflow.com/questions/4004313/html-css-how-to-make-password-input-show-the-password/4004329#4004329...
See this example Hope this help .wufoo { -webkit-column-count: 2; /* Chrome, Safari, Opera */ -moz-column-count: 2; /* Firefox */ column-count: 2; } ...
If you don't want to use conditional comments, then you can use the * html hack: h1 { color: green; } * html h1 { color: red; /* this will...
Option 1 When doing email styling, keep the styles inline. While CSS is supported by many email clients today, the best way to prevent them from interfering with the rest...
Adding vertical-align: bottom to the containing TD seems to do it if I'm understanding you correctly. .stat-table-vert tr:first-of-type td { border-left: 1px solid #090; border-right: 1px solid #090; padding: 0;...
#twitterbootstrap { position:relative; z-index:1000000; } try this... it will work... you need to provide z-index so that overlap will not occure....
You could add pointer-events: none to the .parent divs and then add pointer-events:all to the .child divs. This would mean only the actual children can be clicked. If there is...