Sort Date from newest to Oldest
Sort Date from newest to Oldest
spacemancw
Posts: 34Questions: 9Answers: 0
The first column in my table is a date. When the table loads, it is sorted by that first column. But the oldest dates come to the top.
A row looks like this. The last cell is hidden by the way with "style=display:none" ..
<tr>
<td align=left>2023-09-12 15:47:21</td>
<td align=left> mydata2</td> <td align=left>mydata2</td>
<td align=left> user</td>
<td align=left> mydata3</td>
<td align=left>
<div class="tooltip">
<i class="fa fa-info-circle" style="font-size:18px;color:#5F8575"></i>
<span class="tooltiptext">mydata4</td>
<td style=display:none;>Succeeded</td>
</tr>
How do I make this table load with dates newest to oldest. Of course clicking the column head sorts them ok, but I want them to load properly loaded.
thanks
R
This question has an accepted answers - jump to answer
Answers
Use the
order
option, something like thisorder: [[0, 'desc']],
.Kevin
Excellent! thanks very much. it worked.