Home > front end >  Js table when there is no data to show show no data
Js table when there is no data to show show no data

Time:10-31

Js table when there is no data to show show no data

CodePudding user response:

For example
& lt; Tbody>




The user name & lt;/th>
Telephone & lt;/th>


//traversal data
The function eachData (list) {
$(' # comTable td). The parent (), remove ()
If (list. Length & gt; 0 {
List. The forEach (function (e) {
Var d='
Var t="& lt; Tr gid="+ e.I D +" & gt; " + e.n ame + "& lt;/td> " + e.p hone + "& lt;/td> "
$(' # comTable tbody '). Append (t)
})
} else {
$(' # comTable). Append (" & lt; tr> " )
}
}
  • Related