1

私が持っているテーブルにハイパーリンクを追加しようとしています。私は DataTables Editor を使用しています。この時点では、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