Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:43:59+00:00 2026-05-28T18:43:59+00:00

Could someone help with a quick alternate way to jquery to display alternate rows

  • 0

Could someone help with a quick alternate way to jquery to display alternate rows with different background colors? Trying with a foreach loop but not having much luck. Many thanks!!!

    <div class="acgridhdrstart">Account Name</div>
<div class="acgridhdr">Account Region</div>
<div class="acgridhdr">Account Representative</div>
<div class="acgridhdr">Peer Partner</div>
<div class="acgridhdr">Last Updated</div>
@while (myreader.Read())
{
<div class="bgcol">
 <span class="acgridstart">@myreader["acname"]</span>
 <span class="acgrid">@myreader["acregion"]</span>
 <span class="acgrid">@myreader["acrep"]</span>
 <span class="acgrid">@myreader["acpeer"]</span>
 <span class="acgrid">@myreader["lastupdated"]</span>
</div>
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:44:00+00:00Added an answer on May 28, 2026 at 6:44 pm

    I ended up using SQLDataAdapter and returned the data as follows:

    @for (int i = 0; i < dt.Rows.Count; i++)
    {
        string rowclass = "bgcol";
        if (i % 2 == 0)
        {
            rowclass = "bgalt";
            }
            else
            {
                rowclass = "bgcol";
            }   
    <div class="@rowclass">
     <span class="acgridstart">@dt.Rows[i]["acname"].ToString()</span>
     <span class="acgrid">@dt.Rows[i]["acregion"].ToString()</span>
     <span class="acgrid">@dt.Rows[i]["acrep"].ToString()</span>
     <span class="acgrid">@dt.Rows[i]["acpeer"].ToString()</span>
     <span class="acgrid">@dt.Rows[i]["lastupdated"].ToString()</span>
    </div>
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I was asked if I could help someone to get quick-started to android
could someone help me, i need a php statement that will display an image
Could someone help me afloat here? Still new to F#, actually trying to use
I just have a quick question, im wondering if someone could help me. I
Could someone help me in setting the background of a CellTable row please, I've
Could someone help me out with this JQuery? I have a bunch of list
Could someone help me translate the following pseudo-code into code understood by Helicon Tech's
could someone help me on this problem, i want to access facebook API through
could someone help me with the regex pattern that i could use to match
Could someone help me on this, I have created simple web services using axis2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.