How to externally style with CSS the specific 3 td tags on the html table generated by the pager row of a asp.net gridview control
Tags: asp.net,css,gridview,css-selectors
Problem :
The working version of the html table generated markup with css is here: http://jsfiddle.net/nexU/JkUCQ/1/
As you can see all I need is to set these align and width styles for those 3 specific TD tags on a external css and override the ones that are automatically generated by asp control.
Thanks in advance for your help.
/* I want 1st pagerRow TD to have width 10% I want 2nd pagerRow TD to have width 80% I want 3rd pagerRow TD to have width 10%
*/
/------------style.css------------/
.pagerRow
{
background: #3D6AA2;
font-weight: normal;
color: #fff;
text-align: left;
height: 30px;
}
.pagerRow td
{
border: solid 1px red;
}
/------------ part of html generated by control------------/
<table id="mainContacts" class="contactsBase" cellspacing="0" border="1" style="width: 100%;">
<tbody>
<tr class="header_row">
</tr>
<tr class="odd">
</tr>
<tr class="even">
</tr>
<tr class="odd">
</tr>
<tr class="even">
</tr>
<tr class="odd">
</tr>
<tr class="even">
</tr>
<tr class="odd">
</tr>
<tr class="even">
</tr>
<tr class="odd">
</tr>
<tr class="even">
</tr>
<tr class="odd">
</tr>
<tr class="pagerRow" align="center">
<td colspan="5">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tbody>
<tr>
<td align="left" width="25%"> <!--How to set these align and width styles on external css and override these ones that are automatically generated by asp control?-->
</td>
<td align="center" width="50%"> <!--How to set these align and width styles on external css and override these ones that are automatically generated by asp control?-->
<p> 1,2,3,4,5 </p>
</td>
<td align="right" width="25%"> <!--How to set these align and width styles on external css and override these ones that are automatically generated by asp control?-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Solution :
Working fiddle: http://jsfiddle.net/JkUCQ/4/
(updated based on your new input)
Add this to your CSS:
.pagerRow tr td:nth-child(1) {
width:10% !important;
}
.pagerRow tr td:nth-child(2) {
width:80% !important;
}
.pagerRow tr td:nth-child(3) {
width:10% !important;
}
CSS Howto..
All you have to do is define styles for the different states of the link(s): a:link,a:visited { /* for regular non-hovered, non-active link styles */ width: 16px; height: 16px; background-image:...
If you need a unique identifier for each li tag, the simplest solution is to assign the $pid variable as the id of the element. So like this: echo '<li...
You just need to change the path definition to form an "X" and change the dash pattern and offset to compensate for the changed path length. I've gone simple here...
Check this out. Fiddle: http://jsfiddle.net/tbj3hsmL/ HTML: <div class="footer"> <img src="http://placehold.it/25x25" /> <span class="text">Footer Text</span> </div> CSS: .footer { padding: 10px; background: #ddd; text-align: center; } .footer img { vertical-align: middle;...
full demo uses this menu. Layout To do this, first layout your document so that you have multiple .pages, and each has a unique id. <div class="page" id="home"> <h1>Home</h1> <div...
Just add style attribute in your script, It will work for you, questionBox.setAttribute("style",""background-color":"yellow""); Your code will look like this, function setHeader(){ var questionBox = document.createElement("div"); questionBox.setAttribute("id","questionHolder");...
Here are two options: Absolutely position the first li element and then use a margin to add space to the second list item. Example Here .agendaList ul ul li:first-child {...
Try this please: HTML: <div class="container"> <div class="to-bottom"> this is always @ bottom of parent div </div> </div> CSS: .container{ position: relative; width: 50%; background-color: #eee; min-height: 200px; } .to-bottom{...
That offset is basically the x,y position that the browser has calculated for the element based on it's position css attribute. So if you put a <br> before it or...
As per my knowledge you can not modify pseudo style directly, but you can insert the CSS to the head portion of the DOM by this way, jQuery $( "div"...
I guess that's what you want? body { width: 100vw; height: 100vh; margin: 0px; } .heading { position: relative; width: 100%; height: 20%; background-color: green; font-size: 0px; } .menu_button_container {...
Crystal Reports for Visual Studio has limited HTML formatting. see This Forum Post (Google for more). I've been recently trying to make some formatting on my reports using HTML and...
You should validate your code frequently during development. E.G after each part/chunk revalidate it, and fix errors immediately. that approach speeds up your learning curve, since you instantly learn from...
If you want to use Flexbox you can use flex: 0 0 80% on input and flex: 1 on label also its text-align: center .zoneFiltre { display: flex; } .champs...
Try this code <style type="text/css"> .ololool {color:green} .blacktext{color:black; } </style> <select name="selectedEventTypeId" onchange="this.className=this.options[this.selectedIndex].className" class="blacktext"> <option value="1" class="blacktext">meeting</option> <option...
You want nth-child() on .item. .item:nth-child(odd) .description { background-color: red; } Demo: ...
Rather than ensuring each CSS class name is unique, ensure that the CSS styles cannot clash by including parent elements in your CSS. This is better for structure: HTML: <div...
You're hiding the parent element by calling: #content-body {display:none} So all of the children will be hidden as well regardless of how you target them. What you need to do...
It looks like you're allowed to put HTML markup in the Specification, so change this line: $content = nl2br($this->getProduct()->$method()); to: $content = $this->getProduct()->$method(); and you won't have all the extra...
Do you mean something like this FIDDLE? JS var $dialogpopup = $( ".hiddenimagediv" ).dialog({ autoOpen: false, height: 'auto', width: 'auto', position: {my: "top middle", at: "top middle", of: ".imagediv"}, title:"Your...
Maybe you could use a historical version of CSSBox that is based on CSSParser instead of the newer jStyleParser. It is probably less efficient (all data is represented as strings)...
Change your CSS to .active { background-color: #ffe13a; } or else the background-color is applied to all buttons because of the btnMyAge class....
Add the resizeable function to the left one as well. Check my fiddle to see if that's what you meant. http://jsfiddle.net/xhaxme4c/4/ A better way to do it is to hook...
From my best guess, you can't. That's why CSS3 added that functionality, because CSS2 couldn't do it on its own. There are several CSS framworks that add that functionality. As...
Seems like the Google+ widget detects the space it's in, and in your case is shrinking from 96px to 80px. If you use JavaScript to render then hide it, instead...
Using Jquery background image according to window height See the snippet $(document).ready(function () { var winHeight = $(window).height(); $('.window-height-bg').css('height', winHeight + 'px'); }); body{ margin:0px; } .window-height-bg { width:100%; background:red...
This will do the trick to wrap the selected text with a <span> node. I think you will need to change the getSelection() method in order to make it work...
You can just use css only: #page::after { content: attr(id) 'B ) - #page'; } ...
You can use display: table-cell; Jsfiddle body, html { position: relative; margin: 0; padding: 0; } .new_div { position: absolute; width: 100%; text-align: center; display: table; height: 200px; background-color: red;...
Just add following css: .navbar { position: static; } Currently it is position:fixed....