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

  • Home
  • SEARCH
  • 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 7059177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:12:03+00:00 2026-05-28T04:12:03+00:00

How should I implement a table of 15 by 15 cells if I plan

  • 0

How should I implement a table of 15 by 15 cells if I plan to dynamically update the cells individually?

I began creating the table in my main.xml, but I don’t want to describe the table with 15 TableRow elements and 15 elements in each of those all in one body of code. I feel like even putting just the table itself in a separate file is too bulky. It is possible to create a file of a row and and a file of a table including the row 15 times and dynamically assign different IDs to each cell?

  • 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-28T04:12:04+00:00Added an answer on May 28, 2026 at 4:12 am

    You could do comething like:

    public void generateTable() {
        TableLayout tv = new TableLayout(context);
    
        for (int y = 0; y < 15; y++) {
            TableRow tr = new TableRow(context);
            for (int x = 0; x < 15; x++) {
                TextView tv = new TextView(context);
                tr.addView(tv);
                tv.setText("ID: " + (y*15 + x));
                tv.setId(y*15 + x);
                // And to allow for easy reading
                if (y*15+x % 2 == 0)
                    tv.setBackgroundColor(0xffff0000);
                else
                    tv.setBackgroundColor(0xff0000ff);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a table view which should display cells according to the
I want to implement a vertical UITableView whose cells contain horizontally scrolling table views.
My app should implement login with facebook but I have noticed that every time
I want to implement a derived class that should also implement an interface, that
When I want to implement ViewModel I should cut everything c# code from my
I want to implement following functionality but I am confused if it's possible in
Should I implement named parameters in Java using Hash tables? I saw this entry:
My project is a computer vision java application which should implement the following :
I have an interface for a variety of classes, all of which should implement
I need a C# library to deal with matrices. It should implement singular value

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.