首页 > 其他分享 >前端学习-UI框架学习-Bootstrap5-006-表格

前端学习-UI框架学习-Bootstrap5-006-表格

时间:2024-03-28 17:33:37浏览次数:27  
标签:表格 表头 滚动条 UI 006 table Bootstrap5 com example

菜鸟教程链接

基础表格

<template>

  <div class="container mt-3">
    <h2>基础表格</h2>
    <p>.table 类来设置基础表格的样式:</p>            
    <table class="table">
      <thead>
        <tr>
          <th>Firstname</th>
          <th>Lastname</th>
          <th>Email</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>John</td>
          <td>Doe</td>
          <td>[email protected]</td>
        </tr>
        <tr>
          <td>Mary</td>
          <td>Moe</td>
          <td>[email protected]</td>
        </tr>
        <tr>
          <td>July</td>
          <td>Dooley</td>
          <td>[email protected]</td>
        </tr>
      </tbody>
    </table>
  </div>

</template>

条纹表格.table-striped

<table class="table table-striped"></table>

带边框表格table-bordered

<table class="table table-bordered"></table>

鼠标悬停状态表格table-hover

<table class="table table-hover"></table>

黑色背景表格

<table class="table table-dark"></table>

黑色背景条纹表格

<table class="table table-dark table-striped"></table>

无边框表格

<table class="table table-borderless"></table></table>

给表格行或单元格添加底色

<template>

  <div class="container mt-3">
    <h2>基础表格</h2>
    <p>.table 类来设置基础表格的样式:</p>            
    <table class="table table-borderless">
      <thead>
        <tr class="table-secondary">
          <th>Firstname</th>
          <th>Lastname</th>
          <th>Email</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>John</td>
          <td class="table-success">Doe</td>
          <td>[email protected]</td>
        </tr>
        <tr>
          <td>Mary</td>
          <td>Moe</td>
          <td>[email protected]</td>
        </tr>
        <tr class="table-danger">
          <td>July</td>
          <td>Dooley</td>
          <td>[email protected]</td>
        </tr>
      </tbody>
    </table>
  </div>

</template>

表头颜色

设置表头的颜色,例如 .table-dark 类用于给表头添加黑色背景, .table-light 类用于给表头添加灰色背景:

<table class="table table-borderless">
      <thead class="table-dark">
        <tr>
          <th>Firstname</th>
          <th>Lastname</th>
          <th>Email</th>
        </tr>
      </thead>
</table>

较小的表格

会比平常的稍微小一点

<table class="table table-sm"></table></table>

响应式表格

.table-responsive 类用于创建响应式表格:在屏幕宽度小于 992px 时会创建水平滚动条,如果可视区域宽度大于 992px 则显示不同效果(没有滚动条):

<template>
  <div class="container mt-3">
    <h2>响应式表格</h2>
    <p>.table-responsive 类用于创建响应式表格:在屏幕宽度小于 992px 时会创建水平滚动条,如果可视区域宽度大于 992px 则显示不同效果(没有滚动条):</p>                                                                                      
    <div class="table-responsive">          
    <table class="table">
      <thead>
        <tr>
          <th>#</th>
          <th>Firstname</th>
          <th>Lastname</th>
          <th>Age</th>
          <th>City</th>
          <th>Country</th>
          <th>Sex</th>
          <th>Example</th>
          <th>Example</th>
          <th>Example</th>
          <th>Example</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>1</td>
          <td>Anna</td>
          <td>Pitt</td>
          <td>35</td>
          <td>New York</td>
          <td>USA</td>
          <td>Female</td>
          <td>Yes</td>
          <td>Yes</td>
          <td>Yes</td>
          <td>Yes</td>
        </tr>
      </tbody>
    </table>
    </div>
  </div>

</template>


标签:表格,表头,滚动条,UI,006,table,Bootstrap5,com,example
From: https://www.cnblogs.com/ayubene/p/18101917

相关文章

  • 2024.03.28【UI设计】新拟态风格设计
    新拟态风格就是类似于给图形图案制作出3D的凸出或者凹进效果的风格这个风格的设计需要使用到即时设计软件的蒙版(与ai不同,ai的蒙版仅有透明度蒙版,无轮廓蒙版)新拟态风格的实现主要是通过三个效果:(1)一个相对浅色高斯模糊效果元素、(2)一个相对深色的无效果元素、(3)一个正常颜色的高......
  • 前端学习-UI框架学习-Bootstrap5-005-颜色
    菜鸟教程学习链接字体颜色Bootstrap5提供了一些有代表意义的颜色类:.text-muted,.text-primary,.text-success,.text-info,.text-warning,.text-danger,.text-secondary,.text-white,.text-dark,.text-body(默认颜色,为黑色)and.text-light:可以设置文本颜色透明度......
  • BLE --- UUID 介绍
    UUID简介UUID是一种普遍唯一的标识符,期望在所有空间和所有时间内都是唯一的(更准确地说,独立生成的UUID相同的概率可以忽略不计)。可以以分布式方式独立创建uuid。不需要分配uid的中央注册中心。UUID是128位的值。为了减少存储和传输128位UUID值的负担,预先分配了一系列UUID值,以便......
  • [转][C#] Guid 一些常用方法
    在SQLServer里面,定义GUID类型的字段是:uniqueidentifier生成一个全是0组成的GUID的写法是:cast(cast(0asbinary)asuniqueidentifier)生成一个随机的GUID的写法是:SELECTNEWID()在C#里面,生成Guid的方法是:varnewid=Guid.NewGuid().ToString("d");......
  • 前端学习-UI框架学习-Bootstrap5-004-文字排版
    菜鸟教程链接Bootstrap5默认设置Bootstrap5默认的font-size为16px,line-height为1.5默认的font-family为"HelveticaNeue",Helvetica,Arial,sans-serif此外,所有的元素margin-top:0、margin-bottom:1rem(16px)h1-h6<template><divclass="con......
  • elementUI表单表头增加筛选
    1、增加过滤条件 2、定义数据,必须包含text以及value 3、使筛选的id与行内元素id一直进行筛选 4、对下拉icon大小更改 ......
  • ModuleNotFoundError: No module named ‘paddle.fluid.layers.utils‘关于paddle和pa
    训练模型时候发现的问题:1.ValueError:PretrainedConfiginstancenotfoundinthearguments,youcansetitasargsorkwargswithconfigfield2:ModuleNotFoundError:Nomodulenamed‘paddle.fluid.layers.utils‘对于第一个问题的发生,我先是检查uie-base,但是没......
  • 前端学习-UI框架学习-Bootstrap5-003-网格系统
    菜鸟教程链接Bootstrap提供了一套响应式、移动设备优先的流式网格系统,随着屏幕或视口(viewport)尺寸的增加,系统会自动分为最多12列规则网格每一行需要放在设置了.container(固定宽度)或.container-fluid(全屏宽度)类的容器中,这样就可以自动设置一些外边距与内边距。使......
  • Ant Design 设置必填属性的一个坑!Objects are not valid as a React child (found: ob
    1、刚开始,我是用第一种方式。通过一个变量,来设置必填属性的提示值 显示是没有问题的。但是点击ModalForm确认按钮时,报错ObjectsarenotvalidasaReactchild(found:objectwithkeys{requiredMsg}).Ifyoumeanttorenderacollectionofchildren,useanarray......
  • 软件测试技术分享丨uiautomator2详细使用方法
    本文转自测试人社区,原文链接:https://ceshiren.com/t/topic/53961.简介uiautomator2是一个自动化测试开源工具,仅支持android平台的自动化测试,其封装了谷歌自带的uiautomator2测试框架,可以运行在支持Python的任一系统上,目前版本为2.10.2开源库地址:https://github.com/ope......