はじめに
Cocoonのように「タイムライン」ブロックが標準搭載されていないテーマでも、WordPress標準の「テーブル」ブロックだけでタイムライン風のデザインを実現します。
この記事では、この方法について説明します。
完成イメージ
| 2000年 | 3月 | ○○○株式会社を設立 |
| 9月 | ○○○営業所を開設 | |
| 2020年 | 3月 | ○○○営業所を開設 |
| 2022年 | 3月 | 本社を〇〇〇(現在地)に移転 |
| 9月 | ○○○営業所を開設 |
実装手順
以下の手順で実装します。
- ラベルGutenbergエディターでの設定

Gutenbergエディター 以下に手順を示します。
- 「テーブル」ブロックを配置します。
- 「テーブル」ブロックに高度な設定→追加CSSクラスに
my-timelineと入力します。
- ラベルCSSを追加
以下のコードをstyle.cssに追加します。
.my-timeline { table tr { background-color: transparent; } tr:has(td:first-child:not(:empty)) { border-top: 1px solid #ccc; } td { border: 0; padding: 10px; position: relative; &:nth-child(1) { border-right: 3px solid #ccc; font-weight: bold; width: 6em; } &:nth-child(2) { width: 6em; } &:first-child::before { content: ''; display: block; position: absolute; top: 50%; right: -7px; width: 12px; height: 12px; background-color: #ff0000; border-radius: 50%; transform: translateY(-50%); } } } .body .my-timeline table tr:first-child { border: 0; }
さいごに
今回紹介した方法を使えば、特別なテーマやプラグインを使わなくても、WordPress標準のテーブルブロックだけでタイムライン風のデザインを手軽に実装できます。
シンプルな構造なのでカスタマイズ性も高く、さまざまな場面に応用可能です。
テーマに依存しない柔軟な表現方法として、ぜひ活用してみてください。

