테이블을 정렬하는 데 문제가 있습니다. 내 표 머리글을 클릭하면 표 데이터가 정렬되지 않습니다. "show 10/25/50 항목"과 검색 창을 사용하는 경우에도 마찬가지입니다.정렬이 작동하지 않습니다. 부트 스트랩의 데이터 테이블
매우 오래되었지만 작동하지 않는 것 같습니다. 여기 내 코드가있다. 나는 플러그인 문제 또는 코딩 문제를 생각하지 않는다. 나는 인터넷에서 많은 방법을 시도했지만 모두 작동하지 않습니다. 인터넷 연결로 xampp을 로컬에서 실행하고 있습니다.
$(".contentContainer").css("min-height", $(window).height());
$("textarea").css("height", $(window).height() - 110);
$("textarea").keyup(function() {
$.post("updatediary.php", {
diary: $("textarea").val()
});
});
$(document).ready(function() {
$('#example').DataTable();
});
.navbar-brand {
font-size: 1.8em;
}
#topContainer {
background-image: url("background.jpg");
height: 400px;
width: 100%;
background-size: cover;
}
#topRow {
margin-top: 80px;
text-align: center;
}
#topRow h1 {
font-size: 300%;
}
.bold {
font-weight: bold;
}
.marginTop {
margin-top: 30px;
}
.center {
text-align: center;
}
.title {
margin-top: 100px;
font-size: 300%;
}
#footer {
background-color: #B0D1FB;
padding-top: 70px;
width: 100%;
}
,
marginBottom {
margin-bottom: 30px;
}
.appstoreImage {
width: 250px;
}
.table {
table-layout: fixed;
}
.table td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
<body data-spy="scroll" data-target=".navbar-collapse">
<div class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand">IT Services</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
\t \t \t <span class="sr-only">Toggle navigation</span>
\t \t \t <span class="icon-bar"></span>
\t \t \t <span class="icon-bar"></span>
\t \t \t <span class="icon-bar"></span>
\t \t </div>
\t \t
\t \t
\t \t <div class="collapse navbar-collapse">
\t \t \t
\t \t \t <ul class= "navbar-nav nav pull-right">
\t \t \t \t <li class="active"><a href="mainpage.php">Main</a></li>
\t \t \t \t <li><a href="input.php">New Input</a></li>
\t \t \t \t <li><a href="includes/logout.inc.php">Log Out</a></li>
\t \t \t
\t \t \t
\t \t </div>
\t \t </div> \t \t
\t </div> \t
<div class="container">
\t <div class="jumpbotron">
\t \t <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
\t \t
\t \t \t \t <thead>
\t \t \t \t \t <tr>
\t \t \t \t \t \t <td>Date</td>
\t \t \t \t \t \t <th>Subject</th>
\t \t \t \t \t \t <td>Details</td>
\t \t \t \t \t \t <td>Status</td>
\t \t \t \t \t \t <td>ticket id</td>
\t \t \t \t \t \t <td>Actions</td>
\t \t \t \t \t \t
\t \t \t \t \t </tr>
\t \t \t \t
\t \t \t \t </thead>
\t \t \t \t
\t \t <?php \t \t
\t \t \t \t while($row=mysqli_fetch_array($result))//while look to fetch the result and store in a array $row.
\t \t \t \t {
\t \t \t \t \t
\t \t \t \t \t $date=$row[2];
\t \t \t \t \t $subject=$row[3];
\t \t \t \t \t $detail=$row[4];
\t \t \t \t \t $status=$row[5];
\t \t \t \t \t $tickid=$row[0];
\t \t \t \t ?>
\t \t \t \t
\t \t \t \t <tbody method="post">
\t \t \t \t \t
\t \t \t \t \t <td class="col-md-1"><?php print_r($date); ?></td>
\t \t \t \t \t <td class="col-md-1"><?php print_r($subject); ?></td>
\t \t \t \t \t <td class="col-sm-2"><?php print_r($detail); ?> </td>
\t \t \t \t \t <td class="col-md-1"><?php print_r($status); ?></td>
\t \t \t \t \t <td class="col-md-1"><?php echo $tickid ; ?></td>
\t \t \t \t \t <td class="col-md-1"><a href="detail.php?id=<?php echo $tickid; ?>" name="submit" id="submit" class="btn btn-sm btn-success">Details</td>
\t \t \t \t \t
\t \t \t \t </tbody>
\t \t \t \t
\t \t \t \t
\t \t \t \t <?php } ?>
\t \t \t </table>
\t </div>
\t </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
\t <script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.12/js/jquery.dataTables.min.js"></script>
\t <script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.13/js/dataTables.bootstrap4.min.js"></script>
</body>
은 내가 실종 무엇 태그 알 수 있습니까? – Sypnoticjr
여러 가지 방법 : 1. IDE의 문제 패널을 사용하십시오. 2.이 도구를 사용하십시오 : https://validator.w3.org/ 또는 http://htmlhint.com/ 3. npm을 사용하여 HTML hinters 사용 https://www.npmjs.com/package/htmlhint) 4. 뇌를 사용하십시오! ** 참고 : ** 당신이 HTML로 PHP 코드를 섞어서 어떻게할지는 모르지만 가능합니다. –
누락 된 태그를 모두 추가했습니다. 그러나 헤더를 클릭해도 정렬되지 않은 테이블 – Sypnoticjr