Table Min-max-width Ignored - Stack Overflow

    1. Home
    2. Questions
    3. Tags
    4. Users
    5. Companies
    6. Labs
    7. Jobs
    8. Discussions
    9. Collectives
    10. Communities for your favorite technologies. Explore all Collectives

  1. Teams

    Ask questions, find answers and collaborate at work with Stack Overflow for Teams.

    Try Teams for free Explore Teams
  2. Teams
  3. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Get early access and see previews of new features.

Learn more about Labs Table <colgroup> min-max-width ignored Ask Question Asked 10 years, 6 months ago Modified 10 years, 6 months ago Viewed 14k times 12

Having this http://jsfiddle.net/ihtus/EcU4x/

For the 1st column:

min-width: 100px; max-width: 200px;

But if minimize browser window, 1st column width is getting less than 100px.

Need to have col widths in a range 100-200px. Any workaround?

Share Improve this question Follow asked May 29, 2014 at 19:00 ihtus's user avatar ihtusihtus 2,80114 gold badges44 silver badges61 bronze badges 2
  • Why are you combining inline styles with CSS? You should move all your inline styles into your CSS as otherwise this will be a pain to maintain in the longrun. – James Donnelly Commented May 29, 2014 at 19:02
  • 1 this is just a quick simulation on jsfiddle – ihtus Commented May 29, 2014 at 19:03
Add a comment |

2 Answers 2

Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 10

Tried to remove

table-layout:fixed;

from table style, and that seems to make col have a min-width...

http://jsfiddle.net/ihtus/mGgZ9/

Share Improve this answer Follow answered May 29, 2014 at 19:38 ihtus's user avatar ihtusihtus 2,80114 gold badges44 silver badges61 bronze badges 1
  • 2 In 2020 this does not work. See stackoverflow.com/a/61384205/5397695 – White_Rabbit Commented Apr 23, 2020 at 10:07
Add a comment | 0

Do changes like this

<col style="min-width: 100px; max-width: 200px;"> <col style="min-width:75px;"> <col style="min-width:200px;"> <col style="min-width:auto;"> <col style="min-width:90px;">

set the min-width CSS property to define a minimum width for all the cells. This min-width represent the point at which the browser will add scroll bars rather than resizing the elements on the page.

Share Improve this answer Follow answered May 29, 2014 at 19:34 Tanul's user avatar TanulTanul 3546 silver badges21 bronze badges 1
  • 1 tried that, but no effect. If remove "table-layout:fixed;" from table style => that works – ihtus Commented May 29, 2014 at 19:43
Add a comment |

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid …

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Draft saved Draft discarded

Sign up or log in

Sign up using Google Sign up using Email and Password Submit

Post as a guest

Name Email

Required, but never shown

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.

  • The Overflow Blog
  • Why do developers love clean code but hate writing documentation?
  • This developer tool is 40 years old: can it be improved?
  • Featured on Meta
  • The December 2024 Community Asks Sprint has been moved to March 2025 (and...
  • Stack Overflow Jobs is expanding to more countries

Linked

45 HTML table colgroup element is not working 3 colgroup min-max-width not executed by Chrome 6 min-width and max-width are ignored when element has display:table-cell 21 Width of Table cell based on colgroup not working 69 Table columns, setting both min and max width with css 0 After setting min-width on the cells in one column, table expands past edge of screen 11 max-width not working for table-cell 5 CSS 'min-width' increasing width of table cells larger than value 1 Max and min width for html table not working in CSS 1 max-width does nothing for tables 0 Why is 'max-width' ignored onto table-cell? 0 min-width property is not working on table"s cell?

Hot Network Questions

  • What should I do if I am being guided to walk in circles?
  • What abbreviation for knots do pilots in non-English-speaking countries use?
  • Copyright on photographic reproductions of old paintings
  • why would a search warrant say that the items to search for were the following: hair, fibers, clothing, rope wire, and binding material?
  • What's an Unethical Drug to Limit Anger in a Dystopic Setting
  • Why do some installers insist on not doing a full frame window replacement?
  • A prime number in a sequence with number 1001
  • Short story where unintelligent people sent to Mars are really crashing on Earth
  • Do I need to get a visa (Schengen) for transit?
  • Why doesn't a metal disk expand in all directions when heated?
  • Meaning of the diameter of a space-distorting object
  • Is it possible to symbolically solve this polynomial system of equations and inequalities with Mathematica?
  • Purge an older VirtualBox (7.0) config. Will the current version (7.1) not to be affected?
  • how to increase precision when using the fpu library?
  • Should parameter names describe their object type?
  • Why is it considered terrorism to murder a CEO?
  • How to do a batch of changes in `about:config` in the Firefox?
  • Short story about a city enclosed in an electromagnetic field
  • Convergence of a power series taking values on distributions
  • MotW: Which bonuses stack?
  • Concatenating column vectors in a loop
  • Meaning of Second line of Shakespeare's Sonnet 66
  • What about gravity from the edge of the observable universe?
  • Can a table of results be returned and formatted as a table in Agentforce when an Apex @InvocableMethod is used?
more hot questions Question feed Subscribe to RSS Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-html

Từ khóa » Html Colgroup Max Width