Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can max-width be made to work for tables.

Reply
Thread Tools

Can max-width be made to work for tables.

 
 
AAaron123
Guest
Posts: n/a
 
      09-30-2009
Just for testing I have the following.

<form id="FormMaster" runat="server" style="border: pink 9px Ridge;
max-width: 770px;

<table id="TableMain" style="border: Maroon 9px Ridge; max-width: 750px;
width: 750px">

On the table max-width does not appear to work.

The marron border is much wider that the pink one.



Can max-width be made to work for tables.



Thanks

 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      09-30-2009
"AAaron123" <> wrote in
news:#:

> Just for testing I have the following.
>
> <form id="FormMaster" runat="server" style="border: pink 9px Ridge;
> max-width: 770px;
>
> <table id="TableMain" style="border: Maroon 9px Ridge; max-width:
> 750px; width: 750px">
>
> On the table max-width does not appear to work.
>
> The marron border is much wider that the pink one.
>
>
>
> Can max-width be made to work for tables.


I am not sure what you are attempting to do here, as the code you have
here shows me nothing.

In the first table, you state width = whatever is necessary for the crap
I shoved in the table, but no more than 770 pixels. This means, if it is
an empty table, the table is very small.

In the second table, you state width = 750 pixels and the max width is
750 pixels, so it will be 750 pixels wide no matter what you do.

The way to test the difference in max pixels is to fill the table with a
garbage string of text or something else that will make it expand. For
example, set two images side by side that equal the larger max width
(770px, but minus the border on each side, cell padding, etc.). Then
stick the images in two tables. The larger should end up with the images
side by side, as it can expand to 770 pixels and the smaller should
stack them.

The problem, however, is 2 pixels does not leave you much room for error
in you calculations. Forget to add one cell padding value or cell
spacing value and both will wrap, leading you to believe, as you do with
your "this one has width, this one does not" experiment, that the code
is not working.

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
 
 
 
AAaron123
Guest
Posts: n/a
 
      09-30-2009
Gregory A. Beamer wrote:
> "AAaron123" <> wrote in
> news:#:
>
>> Just for testing I have the following.
>>
>> <form id="FormMaster" runat="server" style="border: pink 9px Ridge;
>> max-width: 770px;
>>
>> <table id="TableMain" style="border: Maroon 9px Ridge; max-width:
>> 750px; width: 750px">
>>
>> On the table max-width does not appear to work.
>>
>> The marron border is much wider that the pink one.
>>
>>
>>
>> Can max-width be made to work for tables.

>
> I am not sure what you are attempting to do here, as the code you have
> here shows me nothing.
>
> In the first table, you state width = whatever is necessary for the
> crap I shoved in the table, but no more than 770 pixels. This means,
> if it is an empty table, the table is very small.
>
> In the second table, you state width = 750 pixels and the max width is
> 750 pixels, so it will be 750 pixels wide no matter what you do.
>
> The way to test the difference in max pixels is to fill the table
> with a garbage string of text or something else that will make it
> expand. For example, set two images side by side that equal the
> larger max width (770px, but minus the border on each side, cell
> padding, etc.). Then stick the images in two tables. The larger
> should end up with the images side by side, as it can expand to 770
> pixels and the smaller should stack them.
>
> The problem, however, is 2 pixels does not leave you much room for
> error in you calculations. Forget to add one cell padding value or
> cell spacing value and both will wrap, leading you to believe, as you
> do with your "this one has width, this one does not" experiment, that
> the code is not working.
>
> Peace and Grace,
>
>
>
> *******************************************
>> Think outside the box! |

> *******************************************


I'm sorry, I should have said that what I presented is above all my markup
that fills the tables.

The markup is quite long.

And the table width does not appear to be constrained at all in the dispay.

It expanded to fit the data inside.

Above the two I showed is:
<body id="BodyMaster" runat="server" style="border: green 9px Ridge;
max-width: 800px;

This also dispalys as expeced - a little wider than the pink border.

But the marron border (table's) is wider than both.



What I'm, seeing seems to be at odds with your comment.

> In the second table, you state width = 750 pixels and the max width is
> 750 pixels, so it will be 750 pixels wide no matter what you do.


I have seen a comment on the Internet Tha max-width is supported by most
browsers.

Also saw one that said that it is not supported by IE but I checked in FF.

I also tried adding overflow:hidden to the table's style but that had no
effect.

Don't know what to try next.


Thanks














 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      09-30-2009
"AAaron123" <> wrote in
news::

> Don't know what to try next.


Step back to the problem you are trying to solve, not the implementation.
This is generally what I find the most useful when I am stuck.

I wish I could give you a more definitive answer, but I don't have a
working example to view, nor enough code to say "change line 10 and you
will be fine".

I am also not sure I completely understand the problem.

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      09-30-2009
Gregory A. Beamer wrote:
> "AAaron123" <> wrote in
> news::
>
>> Don't know what to try next.

>
> Step back to the problem you are trying to solve, not the
> implementation. This is generally what I find the most useful when I
> am stuck.
>
> I wish I could give you a more definitive answer, but I don't have a
> working example to view, nor enough code to say "change line 10 and
> you will be fine".
>
> I am also not sure I completely understand the problem.
>
> Peace and Grace,
>
>
>
> *******************************************
>> Think outside the box! |

> *******************************************




The problem is just that I have max-width defined for body, form and table
but the table width is wider than its max-width.

I can pull rows out of the table until I find the culprit.
Maybe that will tell me something.

The reason for my post is to see if someons said:
Oh year, max-width has problems...
But I understand you believe it works OK.

Thanks



 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      10-01-2009
in html, width refers to the elements content width, so it:

[left-margin][left-border][left-padding][width][right-padding][right-border][right-margin]

so in your case the total width of your table (assuming padding=0 and
margin=0) is 750 + 9 + 9 = 768. of course if the the rows are wider than
this (and don't have a proper overflow specified), they will expand the
width.

-- bruce (sqlwork.com)



AAaron123 wrote:
> Just for testing I have the following.
>
> <form id="FormMaster" runat="server" style="border: pink 9px Ridge;
> max-width: 770px;
>
> <table id="TableMain" style="border: Maroon 9px Ridge; max-width: 750px;
> width: 750px">
>
> On the table max-width does not appear to work.
>
> The marron border is much wider that the pink one.
>
>
>
> Can max-width be made to work for tables.
>
>
>
> Thanks
>

 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      10-01-2009
bruce barker wrote:
> in html, width refers to the elements content width, so it:
>
> [left-margin][left-border][left-padding][width][right-padding][right-border][right-margin]
>
> so in your case the total width of your table (assuming padding=0 and
> margin=0) is 750 + 9 + 9 = 768. of course if the the rows are wider
> than this (and don't have a proper overflow specified),



>they will expand the width.


even past max-width?

I found out that the <asp:Menu> element appears to dominate.
The width will reduce untill it just fits the menu.
Then the width will not reduce any further.
If I make the menu narrower the width will reduce more and all the other
cells shrink OK.
So I'm using a smaller text for the menu and now things work OK.
I was going to look at using the Friendly (I think that's what it is called)
menu but I believe the next framework revision redoes its menu and I didn't
want to have to learn the Friendly method and then have to start over when
framework 4 is available.

Thanks







>
> -- bruce (sqlwork.com)
>
>
>
> AAaron123 wrote:
>> Just for testing I have the following.
>>
>> <form id="FormMaster" runat="server" style="border: pink 9px Ridge;
>> max-width: 770px;
>>
>> <table id="TableMain" style="border: Maroon 9px Ridge; max-width:
>> 750px; width: 750px">
>>
>> On the table max-width does not appear to work.
>>
>> The marron border is much wider that the pink one.
>>
>>
>>
>> Can max-width be made to work for tables.
>>
>>
>>
>> Thanks



 
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
Is there anyway Vpython and pyODE can be made to work with newer versions of Python 2.6.1 etc. without a lot of changes to source code? Casey Hawthorne Python 1 01-24-2009 09:27 PM
Rebel XT, made in Japan, made in Thailand jazu Digital Photography 10 12-12-2006 05:11 AM
Some one donated a few Mac Monitors to this chap, can they be made to work on a PC.. The GHOST of WOGER. NZ Computing 6 05-11-2004 08:59 PM
Game made in VB4 do not work with XP and 2K why? =?Utf-8?B?UGF1bGEgVmFuRHVuZW0=?= Microsoft Certification 1 05-09-2004 05:01 PM
Why doesnt custom TagPrefix work in controls made w/ VBNET? Showjumper ASP .Net 5 07-17-2003 03:48 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