Having A Table-cell Stretch - HTML & CSS - SitePoint Forums Trang chủ » Html Table Stretch » Having A Table-cell Stretch - HTML & CSS - SitePoint Forums Có thể bạn quan tâm Html Table Stretch Cell Html Table Stretch Column Html Table Stretch Full Width Html Table Stretch Height Html Table Stretch Last Column Having a table-cell stretch HTML & CSS NokX May 20, 2016, 6:45pm 1 I’m making a “table” using CSS and DIVs and I’m needing one of the cells to stretch while the others are fixed. The code looks a little something like this right now, and I’m wanting “anotherCell” to stretch to fill up the remaining space. ` Test Testing Testing ` .myTable { display: table; width: 100%; } .myRow { display: table-row; } .myRow div { display: table-cell; } .aCell { width: 100px; } .andAnotherCell { width: 100px; } I’m not sure what to set for the width (if anything) for “anotherCell”. 1 Like SamA74 May 20, 2016, 6:48pm 2 NokX: I’m not sure what to set for the width (if anything) for “anotherCell”. Just leave it unset and it should fill the remaining space left by the others. Tip: If you only want one row, you don’t need the row container. 1 Like NokX May 20, 2016, 7:40pm 3 I may have thousands of rows. I was just using one as a simple example. I am leaving it unset and it’s not stretching. It’s making it the minimum width possible. The table isn’t stretching 100% it doesn’t seem either. PaulOB May 20, 2016, 7:42pm 4 NokX: .myRow div { display: table-cell; } Don’t forget to add vertical-align:top to that rule or the items will align on the baseline and could look odd if images are involved. SamA74: Just leave it unset and it should fill the remaining space left by the others. Yes that’s the beauty of cells and they don’t need widths as all the cells in a row must always equal the width of the parent row. This means that if you give a width to one cell then the other cells will still stretch to fill the available space. Even if you did size all three cells to be smaller than the table width the browser would call that ‘over-constrained’ and ignore the dimension on one of the cells to allow it to extend to the width of the table. NokX May 20, 2016, 8:09pm 5 Well, I have a width of 100% on both the table and table-row classes and it still doesn’t seem to be stretching the one cell. The two cells with explicit widths look like they should but the cell with no width is as small as possible. NokX May 20, 2016, 8:15pm 6 Ugh. Nevermind. I had the “table” div set with an ID instead of a class and I wasn’t referring to it properly in CSS. Problem fixed. Thanks! 1 Like system Closed August 20, 2016, 3:16am 7 This topic was automatically closed 91 days after the last reply. New replies are no longer allowed. Related topics Topic Replies Views Activity Absolute cell width in table Get Started 8 2015 October 8, 2014 Problem with cell width in a table HTML & CSS 9 917 December 26, 2019 Max-width on table-cell? HTML & CSS 4 74051 October 8, 2014 Display: table questions HTML & CSS 14 1644 December 9, 2015 Left-Align, Full-Width `display: table-cell` With One Row HTML & CSS 11 7130 April 3, 2023 Từ khóa » Html Table Stretch Html - Stretching A Table's Width To Fit Web Browser - Stack Overflow How To Create A Full Width Table - W3Schools CSS Table-layout Property - W3Schools Table-layout - CSS: Cascading Style Sheets - MDN Web Docs How Do I Make A Table Stretch Across The Entire Page? - SitePoint Table-layout - CSS-Tricks Table Row And Column Spanning - Home And Learn Stop Tables/Cells From Stretching - Forums How To Set HTML Table Width And Height Stretch Table To Full Width Of Page Prevent Long Strings From Stretching Your With CSS Making A Wild Card Column Width - Tables HTML Tables: All There Is To Know About Them - FreeCodeCamp How To Stop HTML Table Cells Stretching Vertically - Anycodings Liên Hệ TRUYỀN HÌNH CÁP SÔNG THU ĐÀ NẴNG Địa Chỉ: 58 Hàm Nghi - Đà Nẵng Phone: 0905 989 xxx Web: truyenhinhcapsongthu.net Facebook: https://fb.com/truyenhinhcapsongthu/ Twitter: @ Capsongthu Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu