Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > TableRow Borders

Reply
Thread Tools

TableRow Borders

 
 
=?Utf-8?B?QWxleCBNYWdoZW4=?=
Guest
Posts: n/a
 
      04-25-2004
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
 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      04-26-2004
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.)

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxleCBNYWdoZW4=?=
Guest
Posts: n/a
 
      04-26-2004
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.


 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      04-27-2004
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.)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables with different color left and right borders, no top or bottom borders, etc. George HTML 9 10-25-2004 04:25 PM
Span in an ASP TableRow Coleen ASP .Net 2 01-26-2004 11:57 PM
TableRow/TableCell Serverside Q George Durzi ASP .Net 2 11-05-2003 06:48 PM
Click Event for TableRow? Steve - DND ASP .Net 3 07-31-2003 02:40 PM
Simply Displaying Information From TableRow frank ASP .Net 0 07-11-2003 04:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57