기초 형태
Foundation의 <table>
요소 스타일은 회색 얼룩말 줄무늬이며 4개의 테두리를 포함합니다: <table>
元素样式为灰色斑马条纹且包含四个边框:
实例
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body style="padding:20px;"> <h2>基本表格</h2> <p>Foundation 的 table 元素样式为灰色斑马条纹且包含四个边框:</p> <table> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Mary</td> <td>Moe</td> <td>mary@example.com</td> </tr> <tr> <td>July</td> <td>Dooley</td> <td>july@example.com</td> </tr> </tbody> </table> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
响应式表格
使用 CSS 让表格支持响应式设计:在表格外添加 <div>
元素,样式为 overflow-x:hidden
Instance
Run Instance»온라인을 보려면 "인스턴스 실행" 버튼을 클릭하세요. 인스턴스
🎜CSS를 사용하여 테이블이 반응형 디자인을 지원하도록 만드세요. 테이블 외부에 <!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body style="padding:20px;"> <h2>响应式表格</h2> <p>在 div 元素上添加 overflow-x:auto 样式,让它支持响应式。</p> <p>重置浏览器窗口查看效果 (如果空间不足会出现垂直滚动条)。</p> <div class="responsive"> <table> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> <th>City</th> <th>Age</th> <th>Country</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> <td>New York</td> <td>35</td> <td>USA</td> </tr> <tr> <td>Mary</td> <td>Moe</td> <td>mary@example.com</td> <td>Chicago</td> <td>51</td> <td>USA</td> </tr> <tr> <td>July</td> <td>Dooley</td> <td>july@example.com</td> <td>San Francisco</td> <td>38</td> <td>USA</td> </tr> </tbody> </table> </div> </body> </html>
Run Instance»온라인을 보려면 "인스턴스 실행" 버튼을 클릭하세요. 인스턴스
반응형 테이블
overflow-x 스타일로 <div>
요소를 추가하세요. 숨겨진
:🎜🎜🎜Instance🎜🎜rrreee🎜🎜🎜인스턴스 실행»🎜🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요🎜🎜