473,396 Members | 1,998 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,396 software developers and data experts.

Border in C# Table programmatically - Several adjacent horiz & verti cells empty

Border drawn in C# Table programmatically even if several adjacent horizontal & vertical cells are empty in the table

I want to programmatically have border on each and every row and column in the table even if several adjacent horizontal and vertical cells contains no value. The table control (MyTbl) is in ASP. I am programmatically populating the TableCell and TableRow in that MyTbl in ASP. The problem is, no line for the row border gets created if two consecutive rows for a given column are empty. My goal is to have row border for each and every row and column irrespective of the cell value being empty. The MyTbl control in ASP has Gridlines set as both and Borderstyle as solid.

MyTbl control in ASP gets populated as:

TableRow r = new TableRow();

//r.BorderStyle = BorderStyle.Solid;

TableCell cellID = new TableCell();

//cell.BorderStyle = BorderStyle.Solid;

cellID.Text = ..... some kind of value

//r.BorderStyle = BorderStyle.Solid;

r.Cells.Add(cellID);

MyTbl.Rows.Add(r);

I tried adding BorderStyle as Solid to both row and cell with no luck. If two corresponding rows for a given column are empty, no boundary line is drawn between two columns.

How can I have boundary line for each and every row and column even if several horizontal and vertical cells have no value?
Jan 24 '07 #1
2 16478
enreil
86
You may want try asking this in the ASP forum as well...

Border drawn in C# Table programmatically even if several adjacent horizontal & vertical cells are empty in the table

I want to programmatically have border on each and every row and column in the table even if several adjacent horizontal and vertical cells contains no value. The table control (MyTbl) is in ASP. I am programmatically populating the TableCell and TableRow in that MyTbl in ASP. The problem is, no line for the row border gets created if two consecutive rows for a given column are empty. My goal is to have row border for each and every row and column irrespective of the cell value being empty. The MyTbl control in ASP has Gridlines set as both and Borderstyle as solid.

MyTbl control in ASP gets populated as:

TableRow r = new TableRow();

//r.BorderStyle = BorderStyle.Solid;

TableCell cellID = new TableCell();

//cell.BorderStyle = BorderStyle.Solid;

cellID.Text = ..... some kind of value

//r.BorderStyle = BorderStyle.Solid;

r.Cells.Add(cellID);

MyTbl.Rows.Add(r);

I tried adding BorderStyle as Solid to both row and cell with no luck. If two corresponding rows for a given column are empty, no boundary line is drawn between two columns.

How can I have boundary line for each and every row and column even if several horizontal and vertical cells have no value?
Jan 24 '07 #2
kenobewan
4,871 Expert 4TB
I believe that you will get better results using CSS, rather than trying to program the table border style. Set its border, width and color in your stylesheet...

Hope that this helps.
Jan 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Doug Baroter | last post by:
Hi, I'm on SQL Server 2000, say, I have a table named , how I find if there is any column which has a formula in it? In other words, how to identify formula column programmatically? I've...
3
by: bubbles | last post by:
i have a HTML file and it already has a HTML table and a few rows created by default.. however, i would like to add more rows to this table programmatically may i know how?
1
by: Amos | last post by:
Dear Sirs I am trying to build a cash flow software, first I thought to build one table for each cash and bank account, but talking to some people they suggested me to build one unique table for...
2
by: Prakash Wadhwani | last post by:
I have an Access Database called "TEMP" On Opening the "TEMP" Database, I need to use VBA (programmatically): a) to connect to another database called "PMF" b) the PMF database requires a...
1
by: Zlatko Matić | last post by:
Hello. I tried to create table from the query recordset, but it seems that I can't set FieldType and FieldSize by variable...What is wrong? qryrs is QueryDef recordset (pass-through query)... ...
6
by: David Tilman | last post by:
I need to create some tables on a web page at run time rather than design time. There could be 1 - 5 tables on the page depending on options. I've created the tables by creating the cells, rows,...
2
by: Martin Widmer | last post by:
Hi guys I am looking for the best way to generate new reports with reporting services for SQL server 2005. The reports will be generated programmatically from a .Net VB application. So far I see...
0
by: Derek Broughton | last post by:
I have an access table with a column defined as an OLEObject. I can drag and drop an Excel file into this column. I can create a form with an unbound ObjectFrame, and load a spreadsheet into it...
0
by: JacoE | last post by:
Hi, I'm would like to create a new Group, and then add some tables to this group programmatically. Could someone please point me in the right direction. I'm completely stumped on this one. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.