Adding space BETWEEN cells in TableCell()

Posted by user279521 on Stack Overflow See other posts from Stack Overflow or by user279521
Published on 2010-04-22T14:57:34Z Indexed on 2010/04/22 15:03 UTC
Read the original article Hit count: 310

Filed under:
|

My code is below. I want to add space between cells in tableCell() something the equivalent of

<td></td>&nbsp;&nbsp;<td></td>

I am NOT looking for cellpadding or cellspacing because they both add space between the left cell border and the left table border (wall); I want to add space between two CELLS, not the table and the cell;

protected void Page_Init(object sender, EventArgs e)
{
    Table tb = new Table();
    tb.ID = "tb1";

    for (int i = 0; i < iCounter; i++)
    {
        TableRow tr = new TableRow();
        TextBox tbox = new TextBox();
        tbox.ID = i.ToString();

        TableCell tc = new TableCell();
        tc.Controls.Add(tbox);
        tr.Cells.Add(tc);
        tb.Rows.Add(tr);
    }
    pnlScheduler.Controls.Add(tb);
}

Any ideas?

© Stack Overflow or respective owner

Related posts about c#3.5

Related posts about ASP.NET