473,657 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

applying style to table

Hi,
I am working on an asp.net application that has a grid. When rendered,
grids are translated into tables. I am having some problems applying
styles to the this table. When I do a "View Source", this is what I
see:

<table cellspacing="0" cellpadding="3" border="0"
id="ctl00_MainC ontent_SystemsG V" style="font-family:Arial;fo nt-size:
9pt;width:100%; border-collapse:collap se;">
<tr class="gvHeader ">
<th scope="col" style="width:75 px;"><a href="...></th>
</tr>
I am using the following for the "gvHeader" and "th":
..gvHeader
{
background: url(images/gv.jpg);
font-size:9pt;
}

..gvHeader th
{
text-align:left;
padding-left:10px;
color:#FFF;
}
I am not sure how to set up style for a, a:link, a:visited, ... which
are within the "th". I tried .gvHeader th:a.link, but it doesn't work
so I must be wrong. I tried .gvHeade a, a.link, a.visited, ... and it
didn't work either.

Also, a similar problem: I need to apply style to 'a', 'a.link',...
for the gvPager and this is how the pager gets rendered (part of the
above table):

<tr class="gvPager" >
<td colspan="5">
<table border="0">
<tr>
<td><span style="font-family:Arial;"> 1</span></td>
<td><a href="..."></td <------ need to apply style to this
"a"
</tr>
</table>
</td>
</tr>

..gvPager
{
background: url(images/gv.jpg);
font-size:9pt;
font-weight:bold;
text-align:center;
}

..gvPager td
{
color:#000;
}

Mar 8 '07 #1
4 3689
Sid
On 8 Mar 2007 08:06:07 -0800, as*******@hotma il.com wrote:

: I am not sure how to set up style for a, a:link, a:visited, ... which
: are within the "th".
Why don't you set these in the top css. Why is "within the 'th' "?

If the characteristics are different for the a: occurences within the
table only, then qualify the a: like :

A.blue:visited {color: #003399;}
A.blue:link {color: #003399;}
A.blue:hover {color: red;}
A.blue:active {color: #003399;}

A.white:visited {color: #ffffff;}
A.white:link {color: #ffffff;}
A.white:hover {color: red;}
A.white:active {color: #ffffff;}

and then -

<a href="blah1.htm l" class="blue">Bl ue Link</a>
<a href="blah2.htm l" class="white">W hite Link</a>

Sid
Mar 8 '07 #2
On Mar 8, 11:26 am, Sid <e...@nospam.co mwrote:
On 8 Mar 2007 08:06:07 -0800, ashkaa...@hotma il.com wrote:

: I am not sure how to set up style for a, a:link, a:visited, ... which
: are within the "th".

Why don't you set these in the top css. Why is "within the 'th' "?

If the characteristics are different for the a: occurences within the
table only, then qualify the a: like :

A.blue:visited {color: #003399;}
A.blue:link {color: #003399;}
A.blue:hover {color: red;}
A.blue:active {color: #003399;}

A.white:visited {color: #ffffff;}
A.white:link {color: #ffffff;}
A.white:hover {color: red;}
A.white:active {color: #ffffff;}

and then -

<a href="blah1.htm l" class="blue">Bl ue Link</a>
<a href="blah2.htm l" class="white">W hite Link</a>

Sid
Thanks for the reply Sid.
The code I included was the result of the View Source. I do not have
access to the table structure.
I declare the header of the grid to use the gvHeader style. Then, if
there is a link within the header, I want it to be white, no-
decoration, etc.
However, when the grid is rendered, it becomes a table, and the texts
of the header become part of the <th>. So, I need all the links that
happen to be within the
<tr class="gvHeader ><th><a href="..."></th></trto have that specific
style.

Mar 8 '07 #3
Rik
<as*******@hotm ail.comwrote:
<table cellspacing="0" cellpadding="3" border="0"
id="ctl00_MainC ontent_SystemsG V" style="font-family:Arial;fo nt-size:
9pt;width:100%; border-collapse:collap se;">
<tr class="gvHeader ">
<th scope="col" style="width:75 px;"><a href="...></th>
</tr>
I am not sure how to set up style for a, a:link, a:visited, ... which
are within the "th". I tried .gvHeader th:a.link, but it doesn't work
so I must be wrong. I tried .gvHeade a, a.link, a.visited, ... and it
didn't work either.
..gvHeader th a, .gvHeader th a:visited{/* your style */}

Don's listen to the advise to add random classes (and certainly not
classes like 'blue' or 'white', which almost defeat the purpose of using
CSS. Classnames should be more related to content then to styling.). In
seperating style from content it's preferable if you can use contextuel
rules like this.

--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Mar 8 '07 #4
On Mar 8, 12:07 pm, Rik <luiheidsgoe... @hotmail.comwro te:
<ashkaa...@hotm ail.comwrote:
<table cellspacing="0" cellpadding="3" border="0"
id="ctl00_MainC ontent_SystemsG V" style="font-family:Arial;fo nt-size:
9pt;width:100%; border-collapse:collap se;">
<tr class="gvHeader ">
<th scope="col" style="width:75 px;"><a href="...></th>
</tr>
I am not sure how to set up style for a, a:link, a:visited, ... which
are within the "th". I tried .gvHeader th:a.link, but it doesn't work
so I must be wrong. I tried .gvHeade a, a.link, a.visited, ... and it
didn't work either.

.gvHeader th a, .gvHeader th a:visited{/* your style */}

Don's listen to the advise to add random classes (and certainly not
classes like 'blue' or 'white', which almost defeat the purpose of using
CSS. Classnames should be more related to content then to styling.). In
seperating style from content it's preferable if you can use contextuel
rules like this.

--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions:http://tinyurl.com/anel
Thank you Rick,
it worked!

Mar 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3641
by: Jaz | last post by:
Is there a reason why IE wont apply styles on table cells? Either I shouldn't do this, I've got an error somewhere, or IE has a bug or doesn't support it. (Opera and Moz render okay) Since I've Googled for a few hours and looked this up on a number of CSS sites and found nothing, I assume I have an error. Note that when I embed the styles into the head I see the same result. Here's the page: http://harbell.net/elcanco/order.html Any...
1
2887
by: Jonathan | last post by:
I have a specific situation where I am applying padding to text inside of a "P" tag, where if the text wraps then the second line of text ignores the padding. Here is a snippet of what I am doing: <style TYPE="text/css" TITLE="patient_info"> div.questionDiv { border: 1px solid #CCCCCC; width:100%; } p.questionHeaderLabel {
2
1229
by: Tim Joyner | last post by:
I am using the EnableVisualStyle command to apply visual style to my program. After using this command and starting the main form, the images that I have assigned to controls such as the toolbar and treeview control do not display. The text shows up, but no image. Has any one else seen this issue. I am applying visual style using the following command:
7
3494
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme attribute. This works for the content pages, but it doesn't seem able to apply the styles to the top master page even though I did set the master head tag to runat server. Is this by design? If so, what is the best way to apply styles to the top...
1
1299
by: Shimon Sim | last post by:
I have a master page that has a table. The table represents a banner. I need to change background images for the cells depending on the page theme. I set up css and defined styles with background -image: url(...). I set up images in theme folder and it didn't work. Then I decided to move images to root and it didn't work either (the page in not in root. May be for root pages it would help but I can't put all pages in root anyway). Is...
5
1875
by: Dinsdale | last post by:
Without using CSS styles or linked stylesheets, I need to apply formatting to text links that use rollover effects. I can NOT get the underline to show using this technique: <A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION: underline;" onmouseout="this.style.color='#000000' TEXT-DECORATION: none;" href="#">Search</A>
2
5030
by: PJ6 | last post by:
Is there a way of specifying the CSS class of all cells within a table without having to set the class attribute for each cell individually (server-side or client-side)? Paul
6
5689
pradeepjain
by: pradeepjain | last post by:
Hii guys, i am generating a php mail like this $message = ' <html> <head> <style type="text/css" media="all">@import "/themes/admitcard.css";</style> <title>Birthday Reminders for August</title> </head> <body> <div id="textcontent">
1
5898
by: Constantine AI | last post by:
Here is the situation i am currently trying to update a sales order using PHP and javascript. When you click on the edit button it brings you a new site page with existing sales order details within. I am wanting the order lines to be within option boxes so they can modify the order if they wish. I created some javascript for the create sale site page which automatically assigned a price to a particular product once selected. Here is the code...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.