473,625 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Zebra Table

I am trying to create a Zebra table where each Zebra "Strip" consists of two
rows. I am using a classical table to create the Zebra table. In my CSS, I
have

..dark {
background-color: #00FFFF;
}

..light {
background-color: #CCFFFF;
}

<tr class="light ">
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>

<tr class="dark">
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>

I would to wrap the two rows in a single definition, like with a <divor a
<spanbut having been able to make that work.

<div class="light">
<tr>
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>
</div>

<div class="dark">
<tr>
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>
</div>

Appreciate your help. Thanks...

Bruce
Jul 29 '08 #1
10 3420

"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******** *******@bignews 5.bellsouth.net ...
>I am trying to create a Zebra table where each Zebra "Strip" consists of
two rows. I am using a classical table to create the Zebra table. In my
CSS, I have

.dark {
background-color: #00FFFF;
}

.light {
background-color: #CCFFFF;
}

<tr class="light ">
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>

<tr class="dark">
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>

I would to wrap the two rows in a single definition, like with a <divor
a <spanbut having been able to make that work.

<div class="light">
<tr>
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>
</div>

<div class="dark">
<tr>
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>
</div>

Appreciate your help. Thanks...

Bruce
I think I found the solution..

Adding

span.dark tr {
background-color: #00FFFF;

}

span.light tr {
background-color: #CCFFFF;
}

seems to be doing the trick.. Thanks...
Jul 29 '08 #2

"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:ZV******** *******@bignews 5.bellsouth.net ...
>
"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******** *******@bignews 5.bellsouth.net ...
>>I am trying to create a Zebra table where each Zebra "Strip" consists of
two rows. I am using a classical table to create the Zebra table. In my
CSS, I have

.dark {
background-color: #00FFFF;
}

.light {
background-color: #CCFFFF;
}

<tr class="light ">
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>

<tr class="dark">
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>

I would to wrap the two rows in a single definition, like with a <divor
a <spanbut having been able to make that work.

<div class="light">
<tr>
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>
</div>

<div class="dark">
<tr>
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>
</div>

Appreciate your help. Thanks...

Bruce

I think I found the solution..

Adding

span.dark tr {
background-color: #00FFFF;

}

span.light tr {
background-color: #CCFFFF;
}

seems to be doing the trick.. Thanks...
Nope.. It didn't work.. Sorry. Can someone out there in CSS land help me?

Thanks and sorry for the false alarm. It worked fine in Dreamweaver, but
failed in Safari both on my localhost and when I upload it.
Jul 29 '08 #3
Bruce A. Julseth schrieb:
"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******** *******@bignews 5.bellsouth.net ...
> <tr class="light ">
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>
Looks like these are header cells. So use the th element!
> <tr class="dark">
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>
It can/will be difficult for a screen reader user to find out which
column header cells belong to which data cell. You can associate them
via td/@headers and th/@id.
><div class="dark">
<tr>
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>
</div>
Neither can div be a parent element of tr, ...
I think I found the solution..

Adding

span.dark tr {
background-color: #00FFFF;

}
.... nor can span.

However, tbody can.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 29 '08 #4

"Johannes Koch" <ko**@w3develop ment.dewrote in message
news:48******** **************@ read.cnntp.org. ..
Bruce A. Julseth schrieb:
>"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******* ********@bignew s5.bellsouth.ne t...
>> <tr class="light ">
<td class="name">Na me</td>
<td class="addr">St reet</td>
<td class="email">E mail</td>
<td class="interest ">Interests </td>
</tr>
<tr class="light ">
<td>Spouse</td>
<td>Telephone </td>
<td>Spouse Email</td>
<td>Spouse Interests</td>
</tr>

Looks like these are header cells. So use the th element!
>> <tr class="dark">
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>

It can/will be difficult for a screen reader user to find out which column
header cells belong to which data cell. You can associate them via
td/@headers and th/@id.
>><div class="dark">
<tr>
<td class="name">Jo e</td>
<td class="addr">El m</td>
<td class="email">S omething</td>
<td class="interest ">More</td>
</tr>
<tr class="dark">
<td>Jane</td>
<td>999 999-9999</td>
<td>Something Email</td>
<td>Something Interests</td>
</tr>
</div>

Neither can div be a parent element of tr, ...
>I think I found the solution..

Adding

span.dark tr {
background-color: #00FFFF;

}

... nor can span.

However, tbody can.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Thanks for the suggestion on using <th>. I've never used tbody so I'll have
to study how to use it, as well as td/@headers and th/@id.
..
Hope this helps. If anyone else has a suggestion, please send them to me.

Bruce
Jul 29 '08 #5
Bruce A. Julseth schrieb:
Thanks for the suggestion on using <th>. I've never used tbody so I'll have
to study how to use it, as well as td/@headers and th/@id.
See the chapter on tables
(<http://www.w3.org/TR/html4/struct/tables.html>) in the HTML 4.01
specification for tbody
(<http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3>), th/@id and
td/@headers (<http://www.w3.org/TR/html4/struct/tables.html#h-11.4.1>).

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 29 '08 #6
"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******** *******@bignews 5.bellsouth.net ...
>I am trying to create a Zebra table where each Zebra "Strip" consists of
two rows.
No need to set the classes on all the <tr>s, just the odd ones is enough.
Style the <td>s not the <tr>s.

<table class="zebra">
<tr class="light">
<td>Blah</td>
</tr>
<tr class="light">
<td>Blah</td>
</tr>
<tr>
<td>Blah</td>
</tr>
<tr>
<td>Blah</td>
</tr>
</table>

..zebra td {
background-color: #CCFFFF;
}

..zebra .light td {
background-color: #00FFFF;
}

Jul 29 '08 #7
In article <g6**********@r egistered.motza rella.org>,
"Nik Coughlin" <nr******@gmail .comwrote:
"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******** *******@bignews 5.bellsouth.net ...
I am trying to create a Zebra table where each Zebra "Strip" consists of
two rows.

No need to set the classes on all the <tr>s, just the odd ones is enough.
Style the <td>s not the <tr>s.
....

As Nick shows, it is easy enough to implement with just css.
Depending on the nature of your table - how much would be lost if there
were no stripes if js were disabled or unavailable in rare cases - you
might also consider a javascript solution. It saves a lot of bother if
the table is big and changes a lot or if it is generated via php from
csv files on the server.

There is an example of this at

<http://khs.org.au/historian_datab ase/tz.htmland the js at

<http://khs.org.au/historian_datab ase/table_row_strip e.js>

You would need to adapt to your two rows at a time requirements.

--
dorayme
Jul 29 '08 #8

"dorayme" <do************ @optusnet.com.a uwrote in message
news:do******** *************** ***********@new s-vip.optusnet.co m.au...
In article <g6**********@r egistered.motza rella.org>,
"Nik Coughlin" <nr******@gmail .comwrote:
>"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote in message
news:gN******* ********@bignew s5.bellsouth.ne t...
>I am trying to create a Zebra table where each Zebra "Strip" consists of
two rows.

No need to set the classes on all the <tr>s, just the odd ones is enough.
Style the <td>s not the <tr>s.
...

As Nick shows, it is easy enough to implement with just css.
Depending on the nature of your table - how much would be lost if there
were no stripes if js were disabled or unavailable in rare cases - you
might also consider a javascript solution. It saves a lot of bother if
the table is big and changes a lot or if it is generated via php from
csv files on the server.

There is an example of this at

<http://khs.org.au/historian_datab ase/tz.htmland the js at

<http://khs.org.au/historian_datab ase/table_row_strip e.js>

You would need to adapt to your two rows at a time requirements.

--
dorayme
The <tbodysolutio ns does exactly what I want... BUT, I do have frequent
changes which make updating the table a 'bear!' So the JS suggestion is
welcomed. I had read about it somewhere. Thank to pointing me to an example.

Bruce
Jul 30 '08 #9
In article <WU************ ***@bignews2.be llsouth.net>,
"Bruce A. Julseth" <ju***********@ bellsouth.netwr ote:
"dorayme" <do************ @optusnet.com.a uwrote in message
You would need to adapt to your two rows at a time requirements.
I do have frequent
changes which make updating the table a 'bear!' So the JS suggestion is
welcomed. I had read about it somewhere. Thank to pointing me to an example.
If you have frequent changes, you might consider letting some PHP build
your table from a simple csv file (which is just a text file that has
the data with commas after each item, row by row to correspond to tr).
Easier to maintain.

You make the HTML file with a bit of php in place of the table. Put it
on the server along with a plain text file .csv. I do this now and then
and it is quite a time saver. It is especially decent in that it lets a
client prepare the spreadsheet and export to csv format. And you, the
webmaster, simply upload the csv file (or you can get the client to do
this... but it is nice to keep a 'professional' eye on things, one must
be wary of giving clients too much power. They can get ideas that they
can do without you and then how do you pay advance tax bills?)

--
dorayme
Jul 30 '08 #10

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

Similar topics

2
15158
by: Twist Around | last post by:
We have to use a zebra printer to print some specialty labels. I was wondering if anyone had used python to output text to these. I know they use the Zebra Printing Language and before we got into that i was wondering if there was already a module that did this. Any info would be greatly appreciated. Thank You Christopher
6
8751
by: dzemo | last post by:
I have mentioned printer but how to print on him from code? I tried like POS printer copy .txt to LPT port but don't work. I tried print test page- still nothing. Any ideas? thx -- ----------------------------------------------------------------------------------------------------------------------- Dzemal Tipura (Dzemo) - MCP
13
10307
by: ATJaguarX | last post by:
I have a Zebra S500 and multiple S600 label printers. http://www.zebra.com/id/zebra/na/en/index/products/printers/industrial_commercial/s600.html They are currently being used in our legacy Foxpro application just fine. We are upgrading to ASP.NET and Crystal XI. I need to automate the process of printing these labels, so that when the use performs a specific action on the web app, the label automatically prints. The user cannot be...
2
24317
by: Crazyhorse | last post by:
Hi, I am trying to print labels to a zebra printer using the print document object in vb.net. Printing works fine to my local printer but with the Zebra, the data light indicator just flickers a couple of times and nothing else happens? Any help on this would be greatly appreciated Thanks
1
6946
by: steve | last post by:
Hi All Has anybody had experience with printing text and barcodes to Zebra label printers in VB.net 2005 Regards Steve
2
2954
by: cchen1682005 | last post by:
Hi, I am writing an application in C#. Which can adjust the printing position of a Zebra printer, 110XiIII through program instesd of setting on Zebra's panel. Any help on this would be greatly appreciated. Thanks
4
3173
by: =?Utf-8?B?UGF1bCBCdXp6YSwgb2xkc3RlciB1c2luZyBuZXcg | last post by:
I have developed a web-based inventory system for my estate jewelry business using ASP.Net 2.0 and Microsoft SQLServer. The inventory database is also the basis of my website (www.lookwhatifound.biz). I want to print jewelry tags on a local Zebra printer with the label consisting of fields from the web-based SQLServer database. I'm pretty sure I can create the label as a file using ZPL and download the file using the RESPONSE object. ...
9
10277
by: id10t error | last post by:
Hello, I am going to be using a Symbol WT4090 to scan items. I need to printer a tag from the Zebra ql320 plus. I am trying to do this is Visual basic 2005. Does anyone know and good site to find out how to do this. I have looked everywhere i know with no luck. Thank you in advance for your help.
2
6700
by: Flying Kite | last post by:
Hi All, I want to know how to print chinese characters on Zebra Printer, following code working fine with English string, but it's not working for Chinese string. It shows ASCII characters instead of Chinese characters, on my machine I installed language pack and currently set language as Chinese PRC but still it's not working. Option Explicit Private Type DOCINFO pDocName As String pOutputFile As String pDatatype As String
0
8251
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
8182
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,...
0
8688
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
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
8494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4085
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...
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
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.