473,564 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS - additional rule for specific internal tag

49 New Member
I want to create a style rule (class) and give it in the <TABLE> tag (e. g. <TABLE CLASS="blah">. But whenever there is a <TD> in the table, I want an additional rule for the td (e. g. give a border to that td, but not to each element in the td, or any other element in the table), without having to write another class and then do <TD CLASS="blah1">. This is to avoid typing multiple <TD CLASS="blah1"> with each cell and therefore to cut down on HTML cource code.

So my HTML would look like:

Expand|Select|Wrap|Line Numbers
  1. <TABLE CLASS="blah">
  2.    <TR>
  3.       <TD>something
  4.       </TD>
  5.    </TR>
  6.    <TR>
  7.       <TD>something
  8.       </TD>
  9.    </TR>
  10. </TABLE>
  11.  
instead of
Expand|Select|Wrap|Line Numbers
  1. <TABLE CLASS="blah">
  2.    <TR>
  3.       <TD CLASS="blah1">something
  4.       </TD>
  5.    </TR>
  6.    <TR>
  7.       <TD CLASS="blah1">something
  8.       </TD>
  9.    </TR>
  10. </TABLE>
  11.  
Does anyone have any idea how I write the style sheet? I tried this:

Expand|Select|Wrap|Line Numbers
  1. .blah,
  2. .blah a: link,
  3. .blah a: visited
  4. { primary rules }
  5. td.blah: { additional rule for td }
  6.  
but it does not work.

Thank you very much for your time!
Aug 4 '07 #1
2 1231
drhowarddrfine
7,435 Recognized Expert Expert
You were close.

Expand|Select|Wrap|Line Numbers
  1. .blah td{
  2.     background-color:yellow
  3. }
[HTML]
<table class="blah">
<tr>
<td>
something
</td>
</tr>
<tr>
<td>
something
</td>
</tr>
</table>[/HTML]
Aug 4 '07 #2
knkk
49 New Member
Thank you very much, drhowarddrfine! That works just fine. Have a good day.
Aug 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
7119
by: Terry Coccoli | last post by:
We have a Siebel implementation and for one query that was taking a long time to run I asked a DBA to evaluate the explain plan. I noticed that he chose to evaluate the Rule based optimization. I asked him why and he said that the Siebel application defaults to Rule based optimization. Not that I don't trust him, but I had the impression...
4
2952
by: Mike | last post by:
Related to another topic I just posted, I wanted to discuss ways to optimize the validation of very large (>100MB) XML documents. First, I have no idea if something like this already exists; it may even be the typical implementation for all I know. At any rate, it occurs to me that the set of business rules that need to be validated...
10
2944
by: lothar | last post by:
for the horizontal rule element, the w3c HTML 4.01 specification http://www.w3.org/TR/html4/cover.html states that the align, noshade, size and width attributes are deprecated. it gives an example using the deprecated attributes, but no indication as to how to avoid the deprecated attributes. what CSS properties can be used to replace...
2
4270
by: Dalan | last post by:
This ought to be simple enough, but not certain which to use. I have a few fields set to Require data to be entered; however, the message displayed by Access 97 is too generic to be of any real value. I tried attaching a specific message for this in the table properties, but was unsuccessful. Can this be done? I then opted for Not Is Null...
145
6193
by: Sidney Cadot | last post by:
Hi all, In a discussion with Tak-Shing Chan the question came up whether the as-if rule can cover I/O functions. Basically, he maintains it can, and I think it doesn't. Consider two programs: /*** a.c ***/
5
2075
by: pembed2003 | last post by:
Hi all, I am reading the book "C How to Program" and in the chapter where it discuss scope rule, it says there are four scopes for a variable: function scope file scope block scope function-prototype scope I think(might be wrong):
4
8584
by: Mehdi Mousavi | last post by:
Hi, I need to know how to extract a specific icon (32x32 for instance) from an icon file that contains more than one icon size? Any help would be highly appreciated, Cheers. Mehdi
1
1637
by: Prabu Subroto | last post by:
Dear my friends... I want to drop a rule but I get an error message. Could you tell me my I can not drop (delete) the rule? Thank you very much in advance. ps: Here is my try underbelow: postgres@patrix:~> psql kv
2
1268
maxamis4
by: maxamis4 | last post by:
Hello folks need some ideas here for a report that I am getting together. Here is the scenerio, currently we have an SLA that states that an external group transferring a problem to the internal group can qualify this problem as First resolve. Normally I would just grab the first row that has external to internal but the groups are nothing alike...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
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...
0
5213
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
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
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.