473,785 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

10 New Member
Border drawn in C# Table programmaticall y even if several adjacent horizontal & vertical cells are empty in the table

I want to programmaticall y 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 programmaticall y 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.Sol id;

TableCell cellID = new TableCell();

//cell.BorderStyl e = BorderStyle.Sol id;

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

//r.BorderStyle = BorderStyle.Sol id;

r.Cells.Add(cel lID);

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 16513
enreil
86 New Member
You may want try asking this in the ASP forum as well...

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

I want to programmaticall y 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 programmaticall y 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.Sol id;

TableCell cellID = new TableCell();

//cell.BorderStyl e = BorderStyle.Sol id;

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

//r.BorderStyle = BorderStyle.Sol id;

r.Cells.Add(cel lID);

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 Recognized Expert Specialist
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
6535
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 looked at information_schema.columns view for clue but to no avail. Thanks.
3
3800
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
495
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 all bank and cash accounts, putting one more column to identify each bank or cash account. The unique table has this columns structure: ID Date B/C account FinCode Description Debit Credit
2
5727
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 password on opening called "allow" c) to link 5 Tables in the PMF Database ... Table1,2,3,4,5 How do I accomplish the above programmatically using VBA ? Thx & Best Rgds,
1
8693
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)... Set tbl = db.CreateTableDef(IME_TABLICE) For I = 0 To qryrs.Fields.Count - 1
6
1690
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, and tables just as I want them, but I don't know how to get them to render. Is there a function to add the html code for the tables to the aspx file during run time? What is the best way to handle this. Any examples I find to creating tables...
2
8202
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 the only way to do it is to feature my objects (text blocks, pictures, tables drawn from excel and databases etc.) with a "render to RDL"- function and thus create an RDL definition of the report, then push that one to the server using the...
0
1464
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 with a FileDialog and a little VBA code. I can even open the spreadsheet from VBA - either directly from the filesystem or from the embedded object in the form control - and manipulate the individual Cells(). What I can't seem to accomplish is...
0
1486
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. Any code on how to manage these groups will be most helpfull. ps. I'm using MS Access 2000.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.