How do i add a link in a cell

How do i add a link in a cell

moecmoec Posts: 6Questions: 5Answers: 0

I'm trying to add a link to the last cell in my table. This is the code I'm trying to use. I need to use the empNum for the redirecting php page.

$(document).ready(function () {
            var table = $('#example').DataTable({
                paging: false,
                "ajax": "includes/payroll.php",
                "columns": [
                    {
                        "className": 'details-control',
                        "orderable": false,
                        "data": null,
                        "defaultContent": ''
                    },
                    {"data": "empNum"},
                    {"data": "empName"},
                    {"data": "appFlag"},
                    {"data": "unitRate"},
                    {"data": "salary"},
                    {"data": "hourly"},
                    {
                        "data": null,
                        "defaultContent": '<?php echo '<a href=EmployeeInfo.php?empNum='."empNum".'>Info';?>'
                    }

                ],
                "order": [[1, 'asc']]
            });

Answers

This discussion has been closed.