Using Width Property for Table Cells
Despite the expectation, min-width and max-width properties are not applicable to table cells. According to the CSS specification, their effect on table cells is undefined.
Alternative Solution
To define the width for table cells, use the width property instead. It effectively sets the minimum and maximum width for the table cells.
Example:
td {
width: 100px;
}
Table Layout
For further control, you can also set the table-layout property of the table to "fixed." This will enforce a fixed layout, ensuring that the table cells adhere to the specified widths.
Code Example
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3