|
1 | | -# bootstrap-table-column-width |
| 1 | + |
2 | 2 | Responsive Table column width built with Bootstrap 5. Use one of the following classes to manipulate the width of the columns. |
| 3 | + |
| 4 | +Check out [Bootstrap Table column width Documentation](https://mdbootstrap.com/docs/standard/extended/table-column-width/) for detailed instructions & even more examples. |
| 5 | + |
| 6 | +## Basic example |
| 7 | + |
| 8 | +[Bootstrap Table column with auto width: |
| 9 | +](https://mdbootstrap.com/docs/standard/extended/table-column-width/#section-with-auto-width) |
| 10 | + |
| 11 | +```html |
| 12 | + |
| 13 | +<section> |
| 14 | + <!--Table--> |
| 15 | + <table class="table table-striped w-auto"> |
| 16 | + <!--Table head--> |
| 17 | + <thead> |
| 18 | + <tr> |
| 19 | + <th>#</th> |
| 20 | + <th>Name</th> |
| 21 | + <th>Surname</th> |
| 22 | + <th>Country</th> |
| 23 | + <th>City</th> |
| 24 | + <th>Position</th> |
| 25 | + <th>Age</th> |
| 26 | + </tr> |
| 27 | + </thead> |
| 28 | + <!--Table head--> |
| 29 | + |
| 30 | + <!--Table body--> |
| 31 | + <tbody> |
| 32 | + <tr class="table-info"> |
| 33 | + <th scope="row">1</th> |
| 34 | + <td>Kate</td> |
| 35 | + <td>Moss</td> |
| 36 | + <td>USA</td> |
| 37 | + <td>New York City</td> |
| 38 | + <td>Web Designer</td> |
| 39 | + <td>23</td> |
| 40 | + </tr> |
| 41 | + <tr> |
| 42 | + <th scope="row">2</th> |
| 43 | + <td>Anna</td> |
| 44 | + <td>Wintour</td> |
| 45 | + <td>United Kingdom</td> |
| 46 | + <td>London</td> |
| 47 | + <td>Frontend Developer</td> |
| 48 | + <td>36</td> |
| 49 | + </tr> |
| 50 | + <tr class="table-info"> |
| 51 | + <th scope="row">3</th> |
| 52 | + <td>Tom</td> |
| 53 | + <td>Bond</td> |
| 54 | + <td>Spain</td> |
| 55 | + <td>Madrid</td> |
| 56 | + <td>Photographer</td> |
| 57 | + <td>25</td> |
| 58 | + </tr> |
| 59 | + <tr> |
| 60 | + <th scope="row">4</th> |
| 61 | + <td>Jerry</td> |
| 62 | + <td>Horwitz</td> |
| 63 | + <td>Italy</td> |
| 64 | + <td>Bari</td> |
| 65 | + <td>Editor-in-chief</td> |
| 66 | + <td>41</td> |
| 67 | + </tr> |
| 68 | + <tr class="table-info"> |
| 69 | + <th scope="row">5</th> |
| 70 | + <td>Janis</td> |
| 71 | + <td>Joplin</td> |
| 72 | + <td>Poland</td> |
| 73 | + <td>Warsaw</td> |
| 74 | + <td>Video Maker</td> |
| 75 | + <td>39</td> |
| 76 | + </tr> |
| 77 | + <tr> |
| 78 | + <th scope="row">6</th> |
| 79 | + <td>Gary</td> |
| 80 | + <td>Winogrand</td> |
| 81 | + <td>Germany</td> |
| 82 | + <td>Berlin</td> |
| 83 | + <td>Photographer</td> |
| 84 | + <td>37</td> |
| 85 | + </tr> |
| 86 | + <tr class="table-info"> |
| 87 | + <th scope="row">7</th> |
| 88 | + <td>Angie</td> |
| 89 | + <td>Smith</td> |
| 90 | + <td>USA</td> |
| 91 | + <td>San Francisco</td> |
| 92 | + <td>Teacher</td> |
| 93 | + <td>52</td> |
| 94 | + </tr> |
| 95 | + <tr> |
| 96 | + <th scope="row">8</th> |
| 97 | + <td>John</td> |
| 98 | + <td>Mattis</td> |
| 99 | + <td>France</td> |
| 100 | + <td>Paris</td> |
| 101 | + <td>Actor</td> |
| 102 | + <td>28</td> |
| 103 | + </tr> |
| 104 | + <tr class="table-info"> |
| 105 | + <th scope="row">9</th> |
| 106 | + <td>Otto</td> |
| 107 | + <td>Morris</td> |
| 108 | + <td>Germany</td> |
| 109 | + <td>Munich</td> |
| 110 | + <td>Singer</td> |
| 111 | + <td>35</td> |
| 112 | + </tr> |
| 113 | + </tbody> |
| 114 | + <!--Table body--> |
| 115 | + </table> |
| 116 | + <!--Table--> |
| 117 | +</section> |
| 118 | + |
| 119 | + |
| 120 | +``` |
| 121 | + |
| 122 | + |
| 123 | +## How to use? |
| 124 | + |
| 125 | +1. Download MDB 5 - free UI KIT |
| 126 | + |
| 127 | +2. Choose your favourite customized component and click on the image |
| 128 | + |
| 129 | +3. Copy & paste the code into your MDB project |
| 130 | + |
| 131 | +[▶️ Subscribe to YouTube channel for web development tutorials & resources](https://www.youtube.com/MDBootstrap?sub_confirmation=1) |
| 132 | + |
| 133 | +## More examples |
| 134 | + |
| 135 | +[Bootstrap Table column with minimal width: |
| 136 | +](https://mdbootstrap.com/docs/standard/extended/table-column-width/#section-with-minimal-width) |
| 137 | + |
| 138 | +[Bootstrap Table column with fixed width: |
| 139 | +](https://mdbootstrap.com/docs/standard/extended/table-column-width/#section-with-fixed-width) |
| 140 | + |
| 141 | +[Bootstrap Table column with text-nowrap: |
| 142 | +](https://mdbootstrap.com/docs/standard/extended/table-column-width/#section-with-text-nowrap) |
| 143 | + |
| 144 | +___ |
| 145 | + |
| 146 | +## More extended Bootstrap documentation |
| 147 | + |
| 148 | +<ul> |
| 149 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/bootstrap-address-form/">Bootstrap Address Form</a></li> |
| 150 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/avatar/">Bootstrap Avatar</a></li> |
| 151 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/back-to-top/">Bootstrap Back To Top Button</a></li> |
| 152 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/carousel-with-thumbnails/">Bootstrap Carousel Slider with Thumbnails</a></li> |
| 153 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/bullet-list/">Bootstrap Bullet list</a></li> |
| 154 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/chat/">Bootstrap Chat</a></li> |
| 155 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/code/">Bootstrap Code Blocks</a></li> |
| 156 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/comments/">Bootstrap Comments</a></li> |
| 157 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/bootstrap-comparison-table/">Bootstrap Comparison Table</a></li> |
| 158 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/credit-card/">Bootstrap Credit Card Form</a></li> |
| 159 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/drawer/">Bootstrap Drawer</a></li> |
| 160 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/dropdown-multilevel/">Bootstrap Nested Dropdown</a></li> |
| 161 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/faq/">Bootstrap FAQ component / section</a></li> |
| 162 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/gallery/">Bootstrap Gallery</a></li> |
| 163 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/hamburger-menu/">Bootstrap Hamburger Menu</a></li> |
| 164 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/bootstrap-invoice/">Bootstrap Invoice</a></li> |
| 165 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/jumbotron/">Bootstrap Jumbotron</a></li> |
| 166 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/login/">Bootstrap Login Form</a></li> |
| 167 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/maps/">Bootstrap Maps</a></li> |
| 168 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/media-object/">Bootstrap Media Object</a></li> |
| 169 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/mega-menu/">Bootstrap Mega Menu</a></li> |
| 170 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/multiselect/">Bootstrap Multiselect</a></li> |
| 171 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/news-feed/">Bootstrap News Feed</a></li> |
| 172 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/offcanvas/">Bootstrap Offcanvas</a></li> |
| 173 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/order-details/">Bootstrap Order Details</a></li> |
| 174 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/page-transitions/">Bootstrap Page Transitions</a></li> |
| 175 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/payment-forms/">Bootstrap Payment Forms</a></li> |
| 176 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/product-cards/">Bootstrap Product Cards</a></li> |
| 177 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/profiles/">Bootstrap Profiles</a></li> |
| 178 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/quotes/">Bootstrap Quotes</a></li> |
| 179 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/registration/">Bootstrap Registration Form</a></li> |
| 180 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/search-expanding/">Bootstrap Expanding Search Bar</a></li> |
| 181 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/select-with-custom-input//">Bootstrap Select with custom Input</a></li> |
| 182 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/shopping-carts/">Bootstrap Shopping Carts</a></li> |
| 183 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/side-navbar/">Bootstrap Side Navbar</a></li> |
| 184 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/sidebar/">Bootstrap Sidebar</a></li> |
| 185 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/social-media/">Bootstrap Social Media Icons & Buttons</a></li> |
| 186 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/square-buttons/">Bootstrap Square Buttons</a></li> |
| 187 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/bootstrap-survey-form/">Bootstrap Survey Form</a></li> |
| 188 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/testimonial-slider/">Bootstrap Testimonial Slider</a></li> |
| 189 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/testimonials/">Bootstrap Testimonials</a></li> |
| 190 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/textarea/">Bootstrap Textarea</a></li> |
| 191 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/css-text-animations/">Bootstrap Text Animations</a></li> |
| 192 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/timeline/">Bootstrap Timeline</a></li> |
| 193 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/to-do-list/">Bootstrap To Do List</a></li> |
| 194 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/video/">Bootstrap Video</a></li> |
| 195 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/video-carousel/">Bootstrap Video Carousel / Gallery</a></li> |
| 196 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/weather/">Bootstrap Weather</a></li> |
| 197 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/dark-mode/">Bootstrap Dark Mode</a></li> |
| 198 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/padding/">Bootstrap Padding</a></li> |
| 199 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/modal-size/">Bootstrap Modal Size</a></li> |
| 200 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/modal-methods/">Bootstrap Modal Show, Close, Hide & Toggle</a></li> |
| 201 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/modal-backdrop/">Bootstrap Modal Backdrop</a></li> |
| 202 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/card-columns/">Bootstrap Card columns</a></li> |
| 203 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/card-deck/">Bootstrap Card Deck</a></li> |
| 204 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/table-filter/">Bootstrap Table Filter</a></li> |
| 205 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/table-responsive/">Bootstrap Table responsive</a></li> |
| 206 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/slider/">Bootstrap Sliders</a></li> |
| 207 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/slideshow/">Bootstrap Slideshow</a></li> |
| 208 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/logo/">Bootstrap Logo</a></li> |
| 209 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/popup/">Bootstrap Popup</a></li> |
| 210 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/max-width/">Bootstrap Max Width</a></li> |
| 211 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/hero/">Bootstrap Hero</a></li> |
| 212 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/inline-list/">Bootstrap Inline list</a></li> |
| 213 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/select-dropdown/">Bootstrap Select Dropdown</a></li> |
| 214 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/labels/">Bootstrap Labels</a></li> |
| 215 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/dialog/">Bootstrap Dialog</a></li> |
| 216 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/screen-sizes/">Bootstrap Screen Sizes</a></li> |
| 217 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/dropdown-button/">Bootstrap Dropdown Button</a></li> |
| 218 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/widgets/">Bootstrap Widgets & Addons</a></li> |
| 219 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/overlay/">Bootstrap Overlay</a></li> |
| 220 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/height/">Bootstrap Height</a></li> |
| 221 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/popover-on-hover/">Bootstrap Popover on hover</a></li> |
| 222 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/border-radius/">Bootstrap Border radius</a></li> |
| 223 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/table-fixed-header/">Bootstrap Table fixed header</a></li> |
| 224 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/side-menu/">Bootstrap Side Menu</a></li> |
| 225 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/vertical-navbar/">Bootstrap Vertical Navbar</a></li> |
| 226 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/flash-messages">Bootstrap Flash Messages</a></li> |
| 227 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/number-inputs/">Bootstrap Number Inputs</a></li> |
| 228 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/inline-block/">Bootstrap Inline Block</a></li> |
| 229 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/modal-form/">Bootstrap Modal Form</a></li> |
| 230 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/horizontal-list/">Bootstrap Horizontal list</a></li> |
| 231 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/side-panel/">Bootstrap Side panel</a></li> |
| 232 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/navbar-brand/">Bootstrap Navbar brand</a></li> |
| 233 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/select-list/">Bootstrap Select list</a></li> |
| 234 | +<li><a href="https://mdbootstrap.com/docs/standard/extended/cookie-consent//">Bootstrap Cookie Consent</a></li> |
| 235 | + |
| 236 | +</ul> |
0 commit comments