Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Set html table width at run time (in code)

Reply
Thread Tools

Set html table width at run time (in code)

 
 
ruca
Guest
Posts: n/a
 
      07-21-2004
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


 
Reply With Quote
 
 
 
 
Robert Koritnik
Guest
Posts: n/a
 
      07-21-2004
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" <> wrote in message
news:...
> 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
>
>



 
Reply With Quote
 
 
 
 
ruca
Guest
Posts: n/a
 
      07-21-2004
Thanks
Now, how can I get the widht value at run time of a datagrid?

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

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" <> escreveu na
mensagem news:%...
> 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" <> wrote in message
> news:...
> > 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
> >
> >

>
>



 
Reply With Quote
 
Robert Koritnik
Guest
Posts: n/a
 
      07-21-2004
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" <> wrote in message
news:...
> Thanks
> Now, how can I get the widht value at run time of a datagrid?
>
> I have this:
> Dim dgPx As Unit
> dgPx = myDataGrid.Width()
>
> 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" <> escreveu na
> mensagem news:%...
> > 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" <> wrote in message
> > news:...
> > > 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      07-21-2004
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" <> wrote in message
news:...
> 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
>
>



 
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
picture width decides table column width David Basford HTML 3 09-30-2007 10:49 PM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
Set html table width at run time (in code) ruca ASP .Net 4 07-21-2004 02:12 PM
Table width and columns width kris HTML 11 11-18-2003 06:49 AM
Re: resized image in table extends table width to original image width Sean Jorden HTML 1 08-19-2003 08:59 AM



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