473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Question about selection rules syntax

I have a table class that I would like to add specific td and th
styles to.

I can do this:

table.mytable { ... }
table.mytable th { ... }
table.mytable td { ... }

but the th and td are going to be styled identically. I found
that doing

table.mytable { ... }
table.mytable th, table.mytable td { ... }

(In this case, I'm trying to style cell borders differently
from the table border, as well as specifying different margins
and padding in the cells compared to the table as a whole.)

worked, but it seems that there ought to be a way of simplifying
even this. Is there (again, assuming that the th and td styles
are going to be identical in this instance)?
Jul 31 '06 #1
1 1039
David Stone <no******@domain.invalidwrote:
table.mytable { ... }
table.mytable th, table.mytable td { ... }

but it seems that there ought to be a way of simplifying
even this. Is there (again, assuming that the th and td styles
are going to be identical in this instance)?
Well, depending on the specificity of your other selectors you may be
able to drop the table, i.e. .mytable th, .mytable td { ... }

tr>* will select all td and th elements (as they are the only things
that can be immediate children of tr) so the shortest version is
..mytable tr>* { ... }
but that's useless in the real world as IE<7 doesn't support the child
selector.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net <http://steve.pugh.net/>
Jul 31 '06 #2

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

Similar topics

8
by: Bruce Dickey | last post by:
Hi, I've read a number of the meta progamming articles. I have not found what I am looking for. I want to override assignments to variables which are in the module namespace (not object members...
5
by: Eric | last post by:
The following example will explain what i want to do: >>> def func(): print "true" >>> rules=(func,) >>> for rule in rules: rule I expect the final function to print true, but instead i have...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
6
by: Ludwig | last post by:
Hi, i'm using the regular expression \b\w to find the beginning of a word, in my C# application. If the word is 'public', for example, it works. However, if the word is '<public', it does not...
11
by: Xah Lee | last post by:
Of interest: • The Semicolon Wars, by Brian Hayes. 2006. http://www.americanscientist.org/template/AssetDetail/assetid/51982 in conjunction to this article, i recommend: • Software...
2
by: =?Utf-8?B?QmVu?= | last post by:
I have a Customer table in the database that relates to a CustomerType table (I have several other table combinations in the database like Document and DocumentType). As far as I can tell, I...
2
by: piuck | last post by:
I download IBM Synthetic Datat for Association rules(from http://www.almaden.ibm.com/cs/projects/iis/hdb/Projects/data_mining/datasets/syndata.html ), After I compiler it, it found a lot of bug......
18
by: mdh | last post by:
>From p112 ( K&R). Given an array declared as static char arr= { { 0,1,........},{0,1,.....}}; let arr be passed as an argument to f. f( int (*arr) ) {....} It is noted that the...
16
by: Heinrich Pumpernickel | last post by:
i got the following strange extra question in a written test today . since the test was abt c/c++ i guess this is on topic here --8<-- 22) Consider the following quote: "If Mickey's a...
54
by: shuisheng | last post by:
Dear All, I am always confused in using constants in multiple files. For global constants, I got some clues from http://msdn.microsoft.com/en-us/library/0d45ty2d(VS.80).aspx So in header...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...

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.