FooTable で表作成

WordPress でレスポンシブな表を作ることに挑戦したことを書いた。

[WordPress] FooTable で表作成 – with a Christian Wife
https://wacw.cf/2018/07/06/footable-on-wordpress/

ただし、その時はテーマとの相性でうまく動作しなかった(別のテーマだとうまく動いた)。

ということで、WordPress ではない通常ページで FooTable を使った表を作ってみることにした。

jQuery の知識がゼロの私でも、以下のページにそのまま従えば、表を作ることができた。

tableをレスポンシブ対応させるjQueryプラグイン「FooTable」 | サービス | プロエンジニア
http://proengineer.internous.co.jp/content/columnfeature/10743

FooTable のダウンロードおよび、オプション設定方法については以下の公式サイトで。

Getting started – FooTable
http://fooplugins.github.io/FooTable/docs/getting-started.html

ただし、ローカルでは動作しても、レンタルサーバー上にアップすると動作しない。

どうやら jQuery がうまく読み込めていないようだ。

デフォルトでは Google の jQuery から読み込むようになっている。

Hosted Libraries  |  Hosted Libraries  |  Google Developers
https://developers.google.com/speed/libraries/

そこで、jQuery をダウンロードしてきて、それをサーバー上にアップ。そこから読み込んでみた。

jQuery は以下のページの「Download the compressed, production jQuery 3.3.1」をダウンロードした。

Download jQuery | jQuery
https://jquery.com/download/

すると、うまく動いた!