It really depends upon how you're going about trying to add the bottom
border. The best way would be to either put the bottom border in
#chemTable tr { border-bottom: 1px solid #000;} or add a bottom border
to your add and even classes. (i.e. .odd, .even {border-bottom: 1px
solid #000;}  That is assuming that each 'set' represented above is in
a single row.

If not then try something like:
if(rowIndex %3 == 0) {
    $(this).addClass('bottom-border-class);
}



On Jul 30, 8:16 am, "Priest, James (NIH/NIEHS) [C]"
<[EMAIL PROTECTED]> wrote:
> In the book - there is an example for alternating row colors in a table,
> and an expanded version for alternating triplets.
>
> I've got that working - I have a table with two rows of chemical data:
>
> CHEMICAL NAME: BA (GROWTH STIMULANT)
> AMOUNT: 1       UNITS: FL.OZ.   ISOTOPE:        ACTIVITY:
> ACTIVITY/UNITS:
> --------------------------------------------------------------------
> CHEMICAL NAME: GADOLINIUM(III)CHLORIDE HEXAHYDRATE
> AMOUNT: 1       UNITS: FL.OZ.   ISOTOPE:        ACTIVITY:
> ACTIVITY/UNITS:
> --------------------------------------------------------------------
>
> Using the book code - I've got the background striped every other row:
>
>         $(document).ready(
>                 function() {
>                         // $('table#chemtable tr:odd').addClass('odd');
>                         // $("#chemtable tr:even").addClass("even");
>                         var rowClass = "even";
>                         var rowIndex = 0;
>                         $('table#chemtable tr').each(function(index) {
>
>                         if (rowIndex %2==0){
>                         rowClass = (rowClass == "even" ? "odd" :
> "even");
>                         };
>
>                         $(this).addClass(rowClass);
>                         rowIndex++;
>                         });
>                 });
>
> But now I'd like to add a bottom border to each 'set' (like the txt
> example above) but so far my attempts haven't worked... I either get the
> bottom border correct - or my striping on each 'set' gets thrown off..
>
> I'm thinking I need to setup up another index to loop over within the
> main loop?
>
> Thanks,
> Jim

Reply via email to