Table Layout - Tailwind CSS
Có thể bạn quan tâm
| Class | Styles |
|---|---|
| table-auto | table-layout: auto; |
| table-fixed | table-layout: fixed; |
Examples
Sizing columns automatically
Use the table-auto utility to automatically size table columns to fit the contents of its cells:
| Song | Artist | Year |
|---|---|---|
| The Sliding Mr. Bones (Next Stop, Pottersville) | Malcolm Lockyer | 1961 |
| Witchy Woman | The Eagles | 1972 |
| Shining Star | Earth, Wind, and Fire | 1975 |
Using fixed column widths
Use the table-fixed utility to ignore the content of the table cells and use fixed widths for each column:
| Song | Artist | Year |
|---|---|---|
| The Sliding Mr. Bones (Next Stop, Pottersville) | Malcolm Lockyer | 1961 |
| Witchy Woman | The Eagles | 1972 |
| Shining Star | Earth, Wind, and Fire | 1975 |
You can manually set the widths for some columns and the rest of the available width will be divided evenly amongst columns without an explicit width. The widths set in the first row will set the column width for the whole table.
Responsive design
Prefix a table-layout utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<div class="table-auto md:table-fixed ..."> <!-- ... --></div>Learn more about using variants in the variants documentation.
Từ khóa » Html Table Stretch To Fit
-
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
-
HTML Table Fit To Screen: Height, Width
-
Table-layout - CSS: Cascading Style Sheets - MDN Web Docs
-
Fit-content - CSS: Cascading Style Sheets - MDN Web Docs
-
Stop Using To Set Table Width In HTML: Here's Why »
-
How To Set HTML Table Width And Height
-
CSS- Div- Be Careful When You Size Your Divs
-
Stretch Table To Full Width Of Page
-
How Do I Make The Background Image Stretch To Fit The Table Cell?
-
Flexible Table Width - DataTables Example
-
Having A Table-cell Stretch - HTML & CSS - SitePoint Forums
-
How To Fit Table Column To Content Width In Tailwind - Simplernerd