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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:57:46+00:00 2026-06-16T22:57:46+00:00

more of newbies :) I’ve created HTML table using below html code <table runat=server

  • 0

more of newbies 🙂

I’ve created HTML table using below html code

 <table runat="server" id="Table1" border="1" class="style1">
    <tr>
        <td class="style2" colspan="3">
            Info.</td>
        <td class="style2" colspan="2">
            TypeA</td>
        <td class="style2">
            TypeB</td>
        <td class="style2" rowspan="2">
            TypeC</td>
    </tr>
    <tr>
        <td class="style3">
            Dept.</td>
        <td class="style3">
            Div.</td>
        <td class="style3">
            Unit</td>
        <td class="style3">
            TypeA.1</td>
        <td class="style3">
            TypeA.1</td>
        <td style="text-align: center">
            TypeB.1</td>
    </tr>
</table>

I tried to add row for it using

protected void Button1_Click(object sender, EventArgs e)
{
    TableRow tRow = new TableRow();
    for (int i = 1; i < 8; i++)
    {
        TableCell tb = new TableCell();
        tb.Text = "text";
        tRow.Controls.Add(tb);
    }
    Table1.Rows.Add(tRow);
}

but I got :

The best overloaded method match for ‘System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)’ has some invalid arguments

I googled around but with no luck.

I’m doing this to avoid Columns Heading merging action in code behind while I still have to look for how to merge rows heading. This is the last step for completing https://stackoverflow.com/questions/13670384/asp-net-dynamic-input-display-table-by-section-with-multi-columns-rows-headers

,.. closer heading view is:

enter image description here

Rows created will have a forwarding heading cell that should be merged if it’s the same with row above. Appreaciate the great assistant from StackOverflow members.

  • 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-06-16T22:57:47+00:00Added an answer on June 16, 2026 at 10:57 pm

    The error is apparent in the exception.

    You are using TableRow instead of HtmlTableRow.
    Hover over TableRow tRow = new TableRow(); to see which namespace is the TableRow class from.

    A similar change for cell would be required. i.e. use HtmlTableCell instead of TableCell.

    EDIT: Table, TableRow are classes from System.Web.UI.WebControls namespace.
    Whereas, HtmlTable, HtmlTableRow are classes from System.Web.UI.HtmlControls namespace.

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

Sidebar

Related Questions

More than one time I have encountered the following problem when building code with
More C++ learning questions. I've been using vectors primarily with raw pointers with a
Edit: ST does not allow to post more than two links for newbies. Sorry
I wrote some code to connect the application to it's database, then I created
In the following piece of code, using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms;
More of a general MATLAB question than looking for programming advice -- if I
More often than I'd have hoped I seem to come across method/property definitions in
More WCF woes... :) All my workflows implement the same 3 methods. After a
More specifically I want to test whether Oracle ODP.Net is installed on a machine.
More specifically, is List(T)(IEnumerable(T)) thread-safe if the IEnumerable used to initialize the list is

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.