TableRow Borders

Discussion in 'ASP .Net' started by =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 25, 2004.

  1. Okay, I'm sure that this is an incredibly simple one and it may have more to do with HTML than with ASP.NET

    I have an ASP:Table with no borders and that table has several ASP:TableRows, each with several ASP:TableCells in them

    I have no trouble setting the BorderWidth, BorderStyle, etc. of the individual TableCells or even of the whole ASP:Table. But what if I want to set the BorderStyle and BorderColor, etc. of one of the ASP:TableRows? When I do this, I get no errors, but nothing happens. The goal is to outline one of the rows of the table (a box around the whole TableRow, not around each of the row's cells). These properties of the TableRow object don't seem to do anything. Can you help? Do I need to use styles? If so, how

    Thanks

    Alex
     
    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 25, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    [MSFT] Guest

    Hi Alex,

    An asp:TableRow will be rendered into <tr> tag by ASP.NET. An asp:table
    will be rendered like:

    <Table>
    <tr>
    <td>
    ...
    </td>
    </tr>
    </Table>

    The tag "<tr>" cannot have a border seperately. So do the asp:tablerow. I
    think there are several work arounds for this problem:

    1. set all cells' border in the row instead.
    2. set the row's backgroud color instead. If you want to select/highlight a
    row, it is also a good way.

    Hope this help.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], Apr 26, 2004
    #2
    1. Advertising

  3. Two things

    1. If I set the borders of all of the cells in the Row, it has a different look. What I really need is to be able to outline the whole row. Is there any way to do that, maybe using styles for each of the cells so that I can edge them as I want to? (e.g. only the top and left side of a cell, etc.)

    Also, just out of curiosity, what's the point in having BorderStyle, etc. for the TableRow class if it doesn't do anything

    Thanks

    Ale

    ----- [MSFT] wrote: ----

    Hi Alex

    An asp:TableRow will be rendered into <tr> tag by ASP.NET. An asp:table
    will be rendered like

    <Table><tr><td
    ..
    </td></tr></Table

    The tag "<tr>" cannot have a border seperately. So do the asp:tablerow. I
    think there are several work arounds for this problem

    1. set all cells' border in the row instead
    2. set the row's backgroud color instead. If you want to select/highlight a
    row, it is also a good way

    Hope this help

    Luk
    Microsoft Online Suppor

    Get Secure! www.microsoft.com/securit
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.
     
    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 26, 2004
    #3
  4. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    [MSFT] Guest

    Hi Alex,

    The BorderStyle on ASP:TableRow will be grant to the <tr> tag in client
    browser. Hwoever, these styles didn't work with a <tr> tag.

    Your idea for setting style of each cell is also great. Following are code
    to achieve this:

    Dim count As Integer

    Table1.Rows(1).Cells(0).Attributes.Add("style", "BORDER-TOP: ridge;
    BORDER-BOTTOM: ridge;BORDER-LEFT: ridge")

    Table1.Rows(1).Cells(Table1.Rows(1).Cells.Count -
    1).Attributes.Add("style", "BORDER-TOP: ridge; BORDER-BOTTOM:
    ridge;BORDER-RIGHT: ridge")

    For count = 1 To Table1.Rows(1).Cells.Count - 2

    Table1.Rows(1).Cells(count).Attributes.Add("style",
    "BORDER-TOP: ridge; BORDER-BOTTOM: ridge")

    Next


    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], Apr 27, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. frank
    Replies:
    0
    Views:
    342
    frank
    Jul 11, 2003
  2. Steve - DND

    Click Event for TableRow?

    Steve - DND, Jul 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    521
    Steve - DND
    Jul 31, 2003
  3. George Durzi

    TableRow/TableCell Serverside Q

    George Durzi, Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    724
    Nicole Calinoiu
    Nov 5, 2003
  4. Coleen

    Span in an ASP TableRow

    Coleen, Jan 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    456
    coleenholley
    Jan 26, 2004
  5. George
    Replies:
    9
    Views:
    4,921
    George
    Oct 25, 2004
Loading...

Share This Page