473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

TableRow Borders

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
Nov 18 '05 #1
3 7875
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.)

Nov 18 '05 #2
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.
Nov 18 '05 #3
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.)
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hostile17 | last post by:
I've been trying to figure out a good way to make a CSS layout with nice-looking 1-pixel borders around the table cells. The only broadly compatible way to do this I know of is to have * the...
3
by: Rajeev | last post by:
Hi I can use the TableRow and TableCell class in C# while using Web forms. The same are not available while programming with Windows Forms. I have the folloowing code that works fine with Web...
0
by: Randy | last post by:
Hello All, Is there any way to make this happen... Say I want to make a table with 3 rows. The first row has two TableCells each with a width of 300. The second row has one TableCell with the...
2
by: George Durzi | last post by:
Consider this pseudo HTML from a web form <asp:Table> <asp:TableRow> <asp:TableCell> <asp:Table> <asp:TableRow> <asp:TableCell></asp:TableCell> <asp:TableCell></asp:TableCell>...
6
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table...
1
by: Harry | last post by:
Dear All, I would like to know whether it is possible to add a table in tablerow? Dim Table1 As New Table. Dim Row1 As New TableRow Dim Table2 As New Table Row1.Cells.Add(Table2) ...
1
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the...
9
by: Michael Redbourn | last post by:
Hi, I just switched from FP to DW and am very very happy ! So whilst I'm mastering Dreamweaver (gonna be a while yet :-) - I thought that I'd try and find out how to add borders for browers...
2
by: nicstel | last post by:
Hello, I'm trying to find documentation about the xlwt (py_excelerator). I want to change the border of some cells. But the only types that I found is: double and dashed. How to do a simple line...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.