473,583 Members | 3,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

odd/even table rows

I have a long table and I want to have the alternating rows slightly
different colors for clarity.

Is there any way to avoid using a class designation in each tr ?

(yes, it is for tabular data !)
--
Bill Drescher
william {at} TechServSys {dot} com
Jul 20 '05 #1
8 31601
bill drescher <no****@Spamcop .net>:
I have a long table and I want to have the alternating rows slightly
different colors for clarity.

Is there any way to avoid using a class designation in each tr ?

(yes, it is for tabular data !)


<URL:http://www.alistapart. com/articles/zebratables/>

In short, no.

b.

--
Ben Shimmin (ba*@bas.me.uk) <URL:http://bas.me.uk/>
<URL:http://gpg.bas.me.uk/>
Jul 20 '05 #2
in post: <news:10******* ******@corp.sup ernews.com>
bill drescher <no****@Spamcop .net> said:
I have a long table and I want to have the alternating rows slightly
different colors for clarity. Is there any way to avoid using a
class designation in each tr ?
http://moreshit.usenetshit.info/alte...or-thingy.shit
(yes, it is for tabular data !)


thats what they all say

--
b r u c i e
Jul 20 '05 #3
brucie wrote:
in post: <news:10******* ******@corp.sup ernews.com>
bill drescher <no****@Spamcop .net> said:

I have a long table and I want to have the alternating rows slightly
different colors for clarity. Is there any way to avoid using a
class designation in each tr ?

http://moreshit.usenetshit.info/alte...or-thingy.shit


still too much work, and classes are more intuitive

(yes, it is for tabular data !)

thats what they all say

columns are:
Date Location results

looks like tabular data to me, maybe even to you.
--
Bill Drescher
william {at} TechServSys {dot} com
Jul 20 '05 #4
bill drescher wrote:
I have a long table and I want to have the alternating rows
slightly different colors for clarity.

Is there any way to avoid using a class designation in each tr ?


Not until CSS 3 is adopted. Hold your breath. ;-)

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #5
"bill drescher" <no****@Spamcop .net> wrote in
comp.infosystem s.www.authoring.stylesheets:
I have a long table and I want to have the alternating rows slightly
different colors for clarity.

Is there any way to avoid using a class designation in each tr ?


You don't have to class _every_ tr, but you do have to class either
each even row or each odd row. There's no way out there that works
in IE.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #6
"Stan Brown" <th************ @fastmail.fm> wrote in
comp.infosystem s.www.authoring.stylesheets:
"bill drescher" <no****@Spamcop .net> wrote in
comp.infosyste ms.www.authoring.stylesheets:
I have a long table and I want to have the alternating rows slightly
different colors for clarity.

Is there any way to avoid using a class designation in each tr ?


You don't have to class _every_ tr, but you do have to class either
each even row or each odd row. There's no way out there that works
in IE.


Sorry -- that last sentence makes no sense. What I meant to say was
that no way out there will work with IE, _other_ than classing each
even row or classing each odd row. For instance, if you class each
even row with <tr class="even">, your CSS would be:

table tr td { /* odd row stuff */ }

table tr.even td { /* even row stuff */ }

(As others have posted, the real solution is CSS3, but hardly any
browsers support it. Since IE doesn't, and IE users dominate the
market, it hardly matters what other browsers -- if any -- support
CSS3.)

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #7

"bill drescher" <no****@Spamcop .net> wrote in message
news:10******** *****@corp.supe rnews.com...
brucie wrote:
in post: <news:10******* ******@corp.sup ernews.com>
bill drescher <no****@Spamcop .net> said:

I have a long table and I want to have the alternating rows slightly
different colors for clarity. Is there any way to avoid using a
class designation in each tr ?

http://moreshit.usenetshit.info/alte...or-thingy.shit


still too much work, and classes are more intuitive

(yes, it is for tabular data !)

thats what they all say

columns are:
Date Location results

looks like tabular data to me, maybe even to you.


Brucie's reply looks like sarcasm to me. Maybe not to you.

--
JayB
Jul 20 '05 #8
Stan Brown wrote:
"Stan Brown" <th************ @fastmail.fm> wrote in
comp.infosystem s.www.authoring.stylesheets:
"bill drescher" <no****@Spamcop .net> wrote in
comp.infosyst ems.www.authoring.stylesheets:
I have a long table and I want to have the alternating rows slightly
different colors for clarity.

Is there any way to avoid using a class designation in each tr ?


You don't have to class _every_ tr, but you do have to class either
each even row or each odd row. There's no way out there that works
in IE.

Sorry -- that last sentence makes no sense. What I meant to say was
that no way out there will work with IE, _other_ than classing each
even row or classing each odd row. For instance, if you class each
even row with <tr class="even">, your CSS would be:

table tr td { /* odd row stuff */ }

table tr.even td { /* even row stuff */ }

(As others have posted, the real solution is CSS3, but hardly any
browsers support it. Since IE doesn't, and IE users dominate the
market, it hardly matters what other browsers -- if any -- support
CSS3.)


Thanks, that cut the work in half and is educational to boot.
Thank goodness for global find and replace as that makes the rest of the
job easy. (not a css construct, just HTML-Kit)

--
Bill Drescher
william {at} TechServSys {dot} com
Jul 20 '05 #9

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

Similar topics

0
1193
by: Morten Gulbrandsen | last post by:
-------------- SELECT Version() -------------- +--------------------+ | Version() | +--------------------+ | 5.0.0-alpha-max-nt | +--------------------+ 1 row in set (0.00 sec)
4
3288
by: jeffsal | last post by:
I am using sorttable.js to sort a table which works fine which allows a user to sort the table by clicking on the column header. Is there some code I could add to the page (onload or something) to auto sort by the first column without user clicking on it. Here is the sorttable.js code. addEvent(window, "load", sortables_init); var...
33
2461
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following criteria: I have a list of about 100 numbers which correspond to the ID field and also another 40 say numbers corresponding to the numbers in the...
11
2723
by: windandwaves | last post by:
Hi Gurus Is there a way to accentuate even or uneven rows in a table or list? TIA - Nicolaas
6
4970
by: Ward Germonpré | last post by:
Hi, I have a reference to a dom table. How can I retrieve the number of columns in that table ? The stop value below doesn't work, nor did my experimenting with tbodies and childNodes.. .... var thistable = document.getElementById('resultaattbl'); for (var j=0, stop = thistable.tbody.rows.length; j<stop; j++) {
8
2027
by: johkar | last post by:
I would like to ensure this script is optimized (runs correctly or does not execute) for the major browsers. Will checking getElementById and getElementsByTagName accomplish this? In addition, I would like adapt it to ignore table headers or rows with existing classes hardcoded. I haven't been able to get the syntax down. Any help...
7
4808
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want...
6
7983
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data, call determined functions, and edit the data already present What will you need to use the grid? A table with standard markup and an ID to call the...
2
1971
by: cherukuc | last post by:
We have a unique issue where a query does a tablescan even though an index is present. Basically we created a new DB by loading existing data from a source DB. The index names and everything else are same in both the DBs. The query does an index scan in the main source DB but not in the one newly created. Ihave verified the index, and it is...
0
8186
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
8329
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
7936
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...
0
6583
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...
0
5377
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
3821
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...
1
2335
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
1
1436
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1160
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.