# JSで作るテーブルのセルにリンクを張りたい

**URL:** <https://community.cybozu.dev/t/topic/3160>\
**Category:** kintone 開発相談\
**Created:** [2018 年 6 月 22 日午前 3:45 UTC](https://community.cybozu.dev/t/topic/3160 "2018-06-22T03:45:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legacy\_Account688](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Legacy\_Account688](https://community.cybozu.dev/u/Legacy_Account688)\
**Post date:** [2018 年 6 月 22 日午前 3:45 UTC](https://community.cybozu.dev/t/topic/3160/1 "2018-06-22T03:45:19Z")

</div>

JSで作っているテーブルのセルにリンクを含める方法がわかりません。

現在テーブルを表示しているのですがその一部のセルの中をリンクに変更したいです。

document.createElement(‘a’) は作ったのですがこれを

appendChild()を使ってテーブルやtdに入れようとするとエラーが発生します。

&nbsp;

&nbsp;Uncaught TypeError: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’.

&nbsp;

JSではリンクはどうしたらテーブルに表示できるんでしょうか？

---

<div class="post-metadata">

**Author:** ![Legacy\_Account1740](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@Legacy\_Account1740](https://community.cybozu.dev/u/Legacy_Account1740)\
**Post date:** [2018 年 6 月 25 日午前 7:30 UTC](https://community.cybozu.dev/t/topic/3160/2 "2018-06-25T07:30:07Z")

</div>

tanaka様

お世話になっております。  
cstapの江田です。

appendChild()を使ってテーブルのセル(td要素)にa要素を追加することは可能だと思います。  
エラーメッセージを見る限り、appendChild()の引数にa要素を渡せていないようですね。  
もしよろしければ、コードを見せて頂けますでしょうか？
