473,499 Members | 1,721 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 1230
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
7111
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...
4
2943
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...
10
2937
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...
2
4259
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...
145
6147
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...
5
2067
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...
4
8573
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
1628
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: ...
2
1262
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...
0
7128
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,...
0
7169
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,...
0
7215
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...
0
5467
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,...
0
4597
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...
0
3096
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...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
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...

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.