我們也可以通過data-url="data1.json"在普通表上設置來使用遠程 URL 數據。

<table
  data-toggle="table"
  data-url="data1.json">
  <thead>
    <tr>
      <th data-field="id">Item ID</th>
      <th data-field="name">Item Name</th>
      <th data-field="price">Item Price</th>
    </tr>
  </thead>
</table>

data1.json

[
  {
    "id": 0,
    "name": "Item 0",
    "price": "$0"
  },
  {
    "id": 1,
    "name": "Item 1",
    "price": "$1"
  },
  {
    "id": 2,
    "name": "Item 2",
    "price": "$2"
  },
  {
    "id": 3,
    "name": "Item 3",
    "price": "$3"
  },
  {
    "id": 4,
    "name": "Item 4",
    "price": "$4"
  },
  {
    "id": 5,
    "name": "Item 5",
    "price": "$5"
  }
]