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 6129447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:44:37+00:00 2026-05-23T16:44:37+00:00

So i have a stupid problem, sorry but i’m a starter in HTML and

  • 0

So i have a stupid problem, sorry but i’m a starter in HTML and design… What i’m trying to achieve is an upper triangular table, i’m creating my table in asp.net codebehind here is my code;

        for (int i = 0; i < 3; i++)
    {
        TableRow r = new TableRow();
        for (int j = 3; j > i; j--)
        {
            TableCell c = new TableCell()
            {
                Height = 100,
                Width = 100,
                ColumnSpan = j,
                BackColor = System.Drawing.Color.Blue
            };
            r.Cells.Add(c);
        }
        bottomRightTable.Rows.Add(r);
    }

So basically what i want to get is this (sorry for my mad paint skills but i wanted to make my self clear) and again sorry if this is a stupid question but i’m not very experienced with asp.net yet and i don’t want to use any dummy table cells i want to use 6 cells if i want to create a triangle starts with 3.

Thanks a lot for all the help!

Image for help;
enter image description here

  • 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-23T16:44:38+00:00Added an answer on May 23, 2026 at 4:44 pm

    I honestly have no idea if this will work, but try:

    bottomRightTable.Attributes["dir"] = "RTL"; // Set the table to "right-to-left"
    

    Theoretically, it should make the right column 0, the middle column 1, and the left column 2….so you’ll have to reverse any other logic.

    http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1.1


    Your algorithm is using ColumnSpan but it’s not doing anything. That’s because it sets the ColumnSpan to the same value for every cell in the column. ie:

    <table>
        <tr>
            <td colspan="3" style="..."></td>
            <td colspan="2" style="..."></td>
            <td style="..."></td>
        </tr>
        <tr>
            <td colspan="3" style="..."></td>
            <td colspan="2" style="..."></td>
        </tr>
        <tr>
            <td colspan="3" style="..."></td>
        </tr>
    </table>
    

    If you try to fix the ColumnSpan algorithm, you’d end up with:

    <table>
        <tr>
            <td style="..."></td>
            <td style="..."></td>
            <td style="..."></td>
        </tr>
        <tr>
            <td colspan="2" style="..."></td>
            <td style="..."></td>
        </tr>
        <tr>
            <td colspan="3" style="..."></td>
        </tr>
    </table>
    

    squares

    So, basically, I think you either need to use the right-to-left hack or use empty cells.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a stupid question, but I have come across a problem
Sorry for asking a stupid question but I have a problem that makes me
well i have most probably an extremly stupid problem but could not figure it
I have a stupid problem. An jQuery.ajax request return me a full HTML text
First sorry if its a stupid question but i ran into a problem what
I have a little problem with escaping table name. I was so stupid that
I have a probably stupid problem. Im trying to iterate through the vertices of
I have a simple stupid question. Here's the problem, for years, my company has
I have a stupid WinCE application where I'm just trying to force an exception
I'm really sorry. This must seem like an incredibly stupid question, but unless I

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.