1

我正在寻找向我拥有的表格添加超链接。我正在使用 DataTables 编辑器,此时我只是添加标签以便将链接添加到 url。这需要我解析数千个 URL 并添加 url 标签。我有什么方法可以将此应用于表中的特定属性?

<!doctype html>
<html>
 <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    <title>Test</title>

    <link rel="stylesheet" type="text/css" href="css/demo.css">
    <link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css">
    <link rel="stylesheet" type="text/css" href="css/dataTables.tableTools.css">
    <link rel="stylesheet" type="text/css" href="css/dataTables.editor.css">
    <link rel="stylesheet"  type="text/css" href-   "//cdn.datatables.net/responsive/1.0.1/css/dataTables.responsive.css">

    <script type="text/javascript" language="javascript" charset="utf-8" src="js/jquery.min.js"></script>
    <script type="text/javascript" language="javascript" charset="utf-8" src="js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" language="javascript" charset="utf-8" src="js/dataTables.tableTools.min.js"></script>
    <script type="text/javascript" language="javascript" charset="utf-8" src="js/dataTables.editor.min.js"></script>
    <script type="text/javascript" language="javascript" charset="utf-8" src="js/table.Brown_AP.js"></script>
    <script type="text/javascript" language="javascript" charset="utf-8" src="//cdn.datatables.net/responsive/1.0.1/js/dataTables.responsive.min.js"></script>

    <!--FancyBox-->
    <script type="text/javascript" src="fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
    <link rel="stylesheet" href="fancybox/source/jquery.fancybox.css" type="text/css" media="screen" />
    <script type="text/javascript" src="fancybox/source/jquery.fancybox.pack.js"></script>
    <link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-buttons.css" type="text/css" media="screen" />
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-buttons.js"></script>
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-media.js"></script>
    <link rel="stylesheet" href="/fancybox/source/helpers/jquery.fancybox-thumbs.css" type="text/css" media="screen" />
    <script type="text/javascript" src="/fancybox/source/helpers/jquery.fancybox-thumbs.js"></script>

 <script type="text/javascript">
    $(document).ready(function() {
        $(".fancybox").fancybox();
    });
 </script>

 <script>
    $(document).ready(function() {
        $(".various").fancybox({
            maxWidth    : 1600,
            maxHeight   : 1200,
            fitToView   : true,
            width       : '100%',
            height      : '100%',
            autoSize    : true,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none'
        });
});
</script>


<script>
    jQuery(document).ready(function () {
        $('a.modalGeneric').fancybox({
            type: 'iframe',
            fitToView: true,
            autoSize: true,
            openEffect: 'fade',
            openSpeed: 'slow'
        });
});
</script>

</head>
<body>
    <div class="container-fluid">
        <h1>
        <center>
            AP
        </center>
        </h1>

        <table  cellspacing="0" class="display responsive nowrap" id="Brown_AP" width="100%">
            <thead>
                <tr>
                    <th>Building</th>
                    <th>Floor</th>
                    <th>Number of AP</th>
                    <th>Associated Floor Plans</th>
                    <th>AP</th>
                    <th>Status</th>
                </tr>
            </thead>




        </table>

    </div>
</body>
</html>

上面是 HTML 下面是 PHP。我将如何将超链接添加到从 MYSQL 中提取的属性中。

<?php

/*
* Editor server script for DB table AP
* Automatically generated by http://editor.datatables.net/generator
*/

// DataTables PHP library
include( "lib/DataTables.php" );

// Alias Editor classes so they are easy to use
use
   DataTables\Editor,
   DataTables\Editor\Field,
   DataTables\Editor\Format,
   DataTables\Editor\Join,
   DataTables\Editor\Validate;


 // Build our Edit instance and process the data coming from _POST
   Editor::inst( $db, 'APS', 'Assoicated_Floor_Plans' )
     ->fields(
       Field::inst( 'Building' ),
       Field::inst( 'Floor' ),
       Field::inst( 'Number_Of_AP' ),
       Field::inst( 'Associated_Floor_Plans' ),
       Field::inst( 'AP' ),
       Field::inst( 'Status' )
      )
      ->process( $_POST )
      ->json();
4

0 回答 0