Home >Web Front-end >CSS Tutorial >Can I Create a Table Using Only `` and CSS?
Using only HTML's
In the provided HTML snippet, various classes are used to style the elements. For a cross-browser experience, you can adjust the CSS as follows:
.div-table { display: table; width: auto; background-color: #eee; border: 1px solid #666666; border-spacing: 5px; /* cellspacing:poor IE support for this */ } .div-table-row { display: table-row; width: auto; clear: both; } .div-table-col { float: left; /* fix for buggy browsers */ display: table-column; width: 200px; background-color: #ccc; }
In the adjusted CSS:
This updated CSS ensures that the table will be displayed correctly in all major browsers, including IE7 and below.
The above is the detailed content of Can I Create a Table Using Only `` and CSS?. For more information, please follow other related articles on the PHP Chinese website!