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

Home Posts Topics Members FAQ

Set html table width at run time (in code)

Hi

How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time,
i.e., I have this table and I have a datagrid. This datagrid have a variable
width because the number of columns depends of something that I have (that
is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.

NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 20 '05 #1
5 2338
set its attribute runat=server, but you'll probably still have problems
while tables align width depending on its content... You can hardly create
different tables with same width. The only chance is when content never
exceedes desired table (or better said cell) width.

--
RobertK
{ Clever? No just smart. }

"ruca" <ru***@iol.pt > wrote in message
news:e4******** ******@TK2MSFTN GP10.phx.gbl...
Hi

How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time,
i.e., I have this table and I have a datagrid. This datagrid have a variable width because the number of columns depends of something that I have (that
is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.

NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 20 '05 #2
Thanks
Now, how can I get the widht value at run time of a datagrid?

I have this:
Dim dgPx As Unit
dgPx = myDataGrid.Widt h()

But dgPx.Value does not have the value of the grid after binding grid.
Can you help?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Robert Koritnik" <ro************ ************@av tenta.si> escreveu na
mensagem news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
set its attribute runat=server, but you'll probably still have problems
while tables align width depending on its content... You can hardly create
different tables with same width. The only chance is when content never
exceedes desired table (or better said cell) width.

--
RobertK
{ Clever? No just smart. }

"ruca" <ru***@iol.pt > wrote in message
news:e4******** ******@TK2MSFTN GP10.phx.gbl...
Hi

How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time, i.e., I have this table and I have a datagrid. This datagrid have a

variable
width because the number of columns depends of something that I have (that is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.

NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


Nov 20 '05 #3
You will have to set that. I told you in my first answer this is a tough
one. The best suggestion I could give you is to put both (table and
Datagrid) inside another table set both control's width to 100%. They would
perfectly align and everything will depend on the width of the containing
table cell.

And you probably won't have to wory about widths of both parts of the
page... Or better said tables, while a datagris is also a table.

--
RobertK
{ Clever? No just smart. }
"ruca" <ru***@iol.pt > wrote in message
news:ek******** ******@tk2msftn gp13.phx.gbl...
Thanks
Now, how can I get the widht value at run time of a datagrid?

I have this:
Dim dgPx As Unit
dgPx = myDataGrid.Widt h()

But dgPx.Value does not have the value of the grid after binding grid.
Can you help?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Robert Koritnik" <ro************ ************@av tenta.si> escreveu na
mensagem news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
set its attribute runat=server, but you'll probably still have problems
while tables align width depending on its content... You can hardly create
different tables with same width. The only chance is when content never
exceedes desired table (or better said cell) width.

--
RobertK
{ Clever? No just smart. }

"ruca" <ru***@iol.pt > wrote in message
news:e4******** ******@TK2MSFTN GP10.phx.gbl...
Hi

How can I get a html control in my code?
I have a html table that I want the width is defined in code at run

time, i.e., I have this table and I have a datagrid. This datagrid have a

variable
width because the number of columns depends of something that I have (that is not important for this). Now, what I want is that the html table have always the same width of my datagrid because of alignment of both.

NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca



Nov 20 '05 #4
One doesn't do this sort of things in the code. Put both the table and the
grid in another table as it's been suggested in another reply.

Eliyahu

"ruca" <ru***@iol.pt > wrote in message
news:e4******** ******@TK2MSFTN GP10.phx.gbl...
Hi

How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time,
i.e., I have this table and I have a datagrid. This datagrid have a variable width because the number of columns depends of something that I have (that
is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.

NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 20 '05 #5
One doesn't do this sort of things in the code. Put both the table and the
grid in another table as it's been suggested in another reply.

Eliyahu

"ruca" <ru***@iol.pt > wrote in message
news:e4******** ******@TK2MSFTN GP10.phx.gbl...
Hi

How can I get a html control in my code?
I have a html table that I want the width is defined in code at run time,
i.e., I have this table and I have a datagrid. This datagrid have a variable width because the number of columns depends of something that I have (that
is not important for this). Now, what I want is that the html table have
always the same width of my datagrid because of alignment of both.

NOTE: I must have (and want) the datagrid width variable and not fixed
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 20 '05 #6

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

Similar topics

2
7750
by: Stephen Weatherly | last post by:
Could anyone please help me with a problem I am having with my table widths??? If I have 2 images within a td tag, but using CSS relative positioning I position one over the top of the second (I am placing a transparent gif over the top of a normal gif) then the width of my table is large enough to accommodate both images side by side My browsers (both IE ad Firefox) do not appear take into account the relative positioning of my...
4
6153
by: Alex Meier | last post by:
I have the following problem: I need a simple, tabular layout in a webshop. - left column: navigation column with approx. 170px width - right column: content area the goal: the left column should contain a few "boxes" (these are HTML- tables) which should be all of the same width. So, I attributed the left column with 'width="170"' and assigned the attribute 'width="100%"' to all contained <table>s. This should
2
5187
by: Murtix Van Basten | last post by:
Hi, I dont know it is doable, but I wanna ask it anyway. I am pulling 5 different data from a datatable row by row. So each row has 5 fields and row count is variable not a constant. So, each row's fields will be shown in a table in a different design. That means, I cannot use DataGrid, because the view should be different. Here is the html:table structure fo each datarow:
4
2691
by: ruca | last post by:
Hi How can I get a html control in my code? I have a html table that I want the width is defined in code at run time, i.e., I have this table and I have a datagrid. This datagrid have a variable width because the number of columns depends of something that I have (that is not important for this). Now, what I want is that the html table have always the same width of my datagrid because of alignment of both. NOTE: I must have (and want)...
3
2030
by: CalSun | last post by:
I have a datagrid with about 15 columns bound at run time. I create an html table and have this datagrid inside. <table align=center width="90%"> <tr> <td> <asp:datagrid ...... ... </asp:datagrid> </td>
1
1263
by: Coach | last post by:
Is it possible to reference a html table control through code in C#? I want to be able to make a table visible/hidden. -- Coach
16
3501
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record in a hidden field) I wish the user to be able to edit the data in the table, so I have extracted the records into hiddenfield, textareas, dropdown list and checkbox so that they can make changes. I named these elements as arrays and wish to run an...
11
9785
by: Ikke | last post by:
Hi, In my stylesheet I've set the width of a table to 100% - in Opera and Firefox, the table is placed within the containing div and it takes up the total amount of width available. However, in IE the table "jumps" out of it's container and takes over the div to the right. It appears as though the table is taking up a width of 100% as in 100% of the page size, not the div.
2
1327
tolkienarda
by: tolkienarda | last post by:
hi all It's been a long time since i've done actual html code. and i seem to have forgotten how to make <td>'s different widths. for example i want to have a image in the top left taking up 25% of the table and text on the other side taking up 75% and then on the next row have the left colom take 75% and the right take up 25% i dont even know if that is possible following is the code that failed for me. <table width="100%"> <tr> ...
2
1798
by: niths | last post by:
hello, i need html table to be inserted in php code..i tried this but i am getting some problem with it so can anyone help me.. Thank u.. My actual code is this $messageproper ="\n\n" . "Name: " . ucwords($_POST) . "\n" . "Email: " . ucwords($email) .
0
9646
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
9484
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
10350
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
10157
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
10097
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
8983
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
5386
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
4055
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
3658
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.