473,396 Members | 2,038 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.

Minimum width

Hi!
In a web application I'm displaying a table with values from a data record.
Above the values I have a menu with options in a table row:
+----------+----------+----------+
+ Opt. 1 | Opt. 2 | Opt. 3 |
+----------+----------+----------+

When the values change (e.g. because the user switches to edit mode where
there are forms instead of values) the width of the menu changes. This is a
bit confusing.

Can I specify a width for the menu (actually for the whole table of the data
record) which is adhered to as long as the browser window is wide enough?
When the browser window is too small (could happen sometimes) the table
should be scaled, of course.

Regards,
André

Jul 21 '05 #1
1 2045
André,

CSS has min-width and max-width properties that relate to this. You
can put min-width on the individual cells to keep them wide enough and
max-width on the table to stop it from overflowing the width of the
page. For example:

table { max-width: 100%; }
td { min-width: 5em; }

There are, however, some problems with this. First you'll need to
check with the spec to find out what should happen when these min- and
max- constraints conflict. I think you want the max-width to win - is
that what wil happen? Maybe some more knowedgable reader knows all
about this.

Second problem is that Internet Explorer doesn't support these
properties. But you can work around this by installing IE7 (google for
it if you haven't heard of it). In my experience IE7 is a bit slow
imposing max-width, but you should have a go.

Regards,

--Phil.

Jul 21 '05 #2

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

Similar topics

3
by: iinet | last post by:
How can i set in my css a min width for input elements, but leave the max size dynamic? Ben
1
by: Wilfried Mestdagh | last post by:
Hi, If you doubleclick on a dbgrid title separator the column automticly resize to his minumum width. How to do this in code ? -- rgds, Wilfried http://www.mestdagh.biz
2
by: Chuck Bowling | last post by:
I'm trying to figure out how I can get the minumum height required for a textbox containing a string in a given font with a set width and also the converse, the minimum required width of a textbox...
2
by: cshaw | last post by:
Hello Everyone, I am having problems with a listbox control. I have a page with a couple of labels and drop-down lists at the top, and then below there is a table with two columns, the first column...
2
by: Jameson | last post by:
Hi, Dumb question for you: Is there a quick and easy way to ensure a string has a minimum width using format specifier? Should I just write if myString.Length < 8 then myString.PadLeft (...
13
by: Ioannis Vranos | last post by:
Is there any mentioning in the standard of the number of bits of the various built in types, apart from char/signed char/unsigned char types? Or only about the minimum value ranges of them?
2
by: James Harris | last post by:
I'm trying to make sense of the standard C data sizes for floating point numbers. I guess the standards were written to accommodate some particular floating point engines that were popular at one...
1
by: kmobarra | last post by:
Hi everyone. How can I assign an initial width to a "DIV" or "select box"? I want my select box to appear using this width, but expand if its contents are wider than the given with. If I don't...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...
0
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...
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.