jQuery Mobile的Column-Toggle Table classes.columnToggleTable选项

jQuery Mobile的Column-Toggle Table classes.columnToggleTable选项

jQuery Mobile是一个基于HTML5的用户界面系统,旨在制作可在所有智能手机、平板电脑和桌面设备上使用的响应式网站和应用程序。

Column-Toggle表格部件允许在带有复选框的Column按钮的帮助下,隐藏/显示不太重要的列。

在这篇文章中,我们将学习jQuery Mobile Column-Toggle Table classes.columnToggleTable选项。classes.columnToggleTable选项是分配给表格的一个类。

语法:

<div class="ui-table-columntoggle">
// content
</div>

参数:该选项不接受任何参数/参数。

返回类型:该选项不返回任何值。

CDN链接:下面是一些jQuery Mobile脚本,你的项目将需要这些脚本,所以要把它们添加到你的项目中。

<link rel=”stylesheet” href=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
<script src=”https://code.jquery.com/jquery-1.11.1.min.js”></script>
<script src=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”></script>

例子:这个例子描述了jQuery Mobile Column-Toggle Table classes.columnToggleTable Option.

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" 
          content="IE=edge" />
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" 
          href=
"https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
    <script src=
"https://code.jquery.com/jquery-1.11.1.min.js">
    </script>
    <script src=
"https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js">
    </script>
</head>
  
<body>
    <center>
        <div data-role="page" id="gfgpage">
            <div>
                <h1 style="color:green;">GeeksforGeeks</h1>
            </div>
            <div data-role="main" class="ui-content">
                <h3>
                    jQuery Mobile Column-Toggle 
                    Table classes.columnToggleTable Option
                </h3>
                <table data-role="table" 
                       id="gfg-table-column-toggle" 
                       data-mode="columntoggle"
                       class="ui-table-columntoggle ui-table-columntoggle-btn"
                       data-column-btn-theme="b">
                    <thead>
                        <tr>
                            <th>Sl No.</th>
                            <th>Article Title</th>
                            <th data-priority="2">Category</th>
                            <th data-priority="1">Topic</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th>1</th>
                            <td>
                                <a href=
"https://www.geeksforgeeks.org/hashing-data-structure/">
                                    Hashing Data Structure</a>
                            </td>
                            <td>Coding</td>
                            <td>Data Structures</td>
                        </tr>
                        <tr>
                            <th>2</th>
                            <td><a href=
"https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/">
                                    Graph Data Structure And Algorithms</a>
                            </td>
                            <td>Coding</td>
                            <td>Data Structures</td>
                        </tr>
                        <tr>
                            <th>3</th>
                            <td><a href=
"https://www.geeksforgeeks.org/ml-multiple-linear-regression-using-python/">
                                    ML | Multiple Linear Regression using Python</a>
                            </td>
                            <td>Machine Learning</td>
                            <td>Supervised Learning</td>
                        </tr>
                        <tr>
                            <th>4</th>
                            <td><a href=
"https://www.geeksforgeeks.org/implementing-dbscan-algorithm-using-sklearn/">
                                    Implementing DBSCAN algorithm using Sklearn</a>
                            </td>
                            <td>Machine Learning</td>
                            <td>Unsupervised Learning</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </center>
</body>
  
</html>

输出:

jQuery Mobile的Column-Toggle Table classes.columnToggleTable选项

jQuery Mobile的Column-Toggle Table classes.columnToggleTable选项

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程