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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:24:10+00:00 2026-06-13T02:24:10+00:00

I am creating table from code behind to show weekly report. It is working

  • 0

I am creating table from code behind to show weekly report. It is working fine. But now problem arises if data is large in table cell. I want to make a link in cell if data is larger to fit in the table cell and onclick show whole data of cell in a popup. or something like this. I try overflow scroll but it looks bad.
My code from which i generating table is:-

private void TaskTable(TaskSearch search)
{

    _empList = _objDBL.GetEmpList(ddlCategory.SelectedValue);
    Label heading = new Label();
    heading.Text ="Task Report from "+search.FromDate.ToString("dd MMM,yyyy")+" to "+search.ToDate.ToString("dd MMM,yyyy");
    heading.Attributes.Add("class", "weekheading");

    divTaskTable.Controls.Add(heading);
    Session["Lable"] = heading;
    Table table = new Table();
    TableRow row;
    TableCell cell;
    TableHeaderRow headerRow = new TableHeaderRow();
    TableHeaderCell headerCell;
    table.CssClass = "grid-view";

    headerCell = new TableHeaderCell();
    headerCell.Text = "Emp Name";
    headerRow.Cells.Add(headerCell);
    headerCell = new TableHeaderCell();
    headerCell.Text = "Monday";
    headerRow.Cells.Add(headerCell);
    headerCell = new TableHeaderCell();
    headerCell.Text = "Tuesday";
    headerRow.Cells.Add(headerCell);
    headerCell = new TableHeaderCell();
    headerCell.Text = "Wednesday";
    headerRow.Cells.Add(headerCell);
    headerCell = new TableHeaderCell();
    headerCell.Text = "Thursday";
    headerRow.Cells.Add(headerCell);
    headerCell = new TableHeaderCell();
    headerCell.Text = "Friday";
    headerRow.Cells.Add(headerCell);
    headerCell = new TableHeaderCell();
    headerCell.Text = "Saturday";
    headerRow.Cells.Add(headerCell);

    table.Rows.Add(headerRow);
    for (int i = 0; i < _empList.Count; i++)
    {
        int m=1;
        row = new TableRow();
        cell = new TableCell();
        cell.Text = _empList[i].Name;
        row.Cells.Add(cell);
        search.EmpId = _empList[i].Id;
        _taskList = _objDBL.GetSearchedTaskList(search);
        string[] months = System.Globalization.DateTimeFormatInfo.InvariantInfo.DayNames;

        for (int j = 0; m < months.Count() && j<_taskList.Count; m++)
        {
            if (_taskList[j].Date.DayOfWeek.ToString().Equals(months[m]))
            {
                cell = new TableCell();
                cell.Text = _taskList[j++].TodaysTask;
                row.Cells.Add(cell);
            }
            else
            {
                cell = new TableCell();
                cell.Text = "-";
                row.Cells.Add(cell);
            }

        }
        for (; m < 7; m++)
        {
            cell = new TableCell();
            cell.Text = "-";
            row.Cells.Add(cell);
        }
        table.Rows.Add(row);
    }
    divTaskTable.Controls.Add(table);
    Session["Table"] = table;
} 
  • 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-13T02:24:11+00:00Added an answer on June 13, 2026 at 2:24 am

    This is how I do it on our site for product descriptions, the text is greater than 75 characters it generates a shorter text then a Full Description link. I’m sure you could modify it to your code. My site is in VB.NET and this code is for a gridview control, but you get the gist of it.

     If descLength >= 75 then
          CType(row.FindControl("shortDesc"), Label).Text = CType(row.FindControl("labelDesc"), Label).Text.Substring(0, 74) & "... <a href='/detailsfp.aspx?prodid=" & productIDM & "'>Full Description</a>"
     End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a table from code behind file & putting on a placeholder. //On
I'm working on creating a SQL query that will pull records from a table
I have created HTML TABLE from JSON data of PHP using JQuery. After creating
I am creating ado.net entity frameworks from table from by database. Because i am
I'm creating a table inside a repeater programmatically. My problem is that the cells
I have a website with a table that is populated with data from various
I am creating a table based on result from servlet, which contains a checkbox
I have a little question about creating a table using another tables. my code:
I am creating a table dynamically, and including some preformatted text from an xml
This is my first time creating php/mysql code from scratch and Im a little

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.