473,657 Members | 2,585 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 31607
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
1198
by: Morten Gulbrandsen | last post by:
-------------- SELECT Version() -------------- +--------------------+ | Version() | +--------------------+ | 5.0.0-alpha-max-nt | +--------------------+ 1 row in set (0.00 sec)
4
3291
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 SORT_COLUMN_INDEX;
33
2478
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 PRODUCT field. I want to show the rows that correspond to both these criteria.
11
2724
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
2028
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 appreciated. If there is an existing script that will do all this, that is fine too. I haven't found...
7
4811
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 to be moved (while sorting) relative to their parent rows. The following is my complete html code...
6
7989
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 script that will turn the table into a grid Parameters: tabelaID => id of the table that will...
2
1973
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 exactly the same in both the DBs. Any insights on what could be the issue ? Thanks Ranjan
0
8397
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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,...
1
8503
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 most users, this new feature is actually very convenient. If you want to control the update process,...
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
4158
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
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
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
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.