# Embedding Input.table() into HTML block

**URL:** <https://talk.observablehq.com/t/embedding-input-table-into-html-block/7789>\
**Category:** Help\
**Created:** [March 25, 2023, 4:11pm UTC](https://talk.observablehq.com/t/embedding-input-table-into-html-block/7789 "2023-03-25T16:11:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aditya](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@aditya](https://talk.observablehq.com/u/aditya)\
**Post date:** [March 25, 2023, 4:11pm UTC](https://talk.observablehq.com/t/embedding-input-table-into-html-block/7789/1 "2023-03-25T16:11:22Z")

</div>

I want to embed an `Input.table()` into a block of HTML, but also be able to select a row and use the value of the selection to show other graphs.

I.e: I have a user table, and when I select the radio button on a row, a graph pops up to the right of the Input.table() corresponding to info for that user.

Right now, if want to know the value of a selected row, I need to do:

```auto
viewof selected_row = Input.table(user_table)

```

But I want to be able to do that in a HTML block like below:

```auto
<div style="display: flex; flex-direction: row">
  <div>
  ${Input.table(user_table)}
  </div>
  <div>
  ${/ **Show some graph based on selected_row** /}
  </div>
</div>

```

I know I can’t include `viewof ...` in the html block, so i’m not sure how to get the value of the selected row.

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)\
**Post date:** [March 25, 2023, 9:16pm UTC](https://talk.observablehq.com/t/embedding-input-table-into-html-block/7789/2 "2023-03-25T21:16:32Z")

</div>

If you define a table using something like

```
viewof t = Inputs.table(...)

```

in one cell, then `t` refers to the value of the input and `viewof t` refers to the dom element. Thus, you can incorporate it into another cell by referring to `viewof t`.

Here’s an example:

https://observablehq.com/embed/fff5cbd42d938961@32?cells=div

---

<div class="post-metadata">

**Author:** ![aditya](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@aditya](https://talk.observablehq.com/u/aditya)\
**Post date:** [March 26, 2023, 12:43am UTC](https://talk.observablehq.com/t/embedding-input-table-into-html-block/7789/3 "2023-03-26T00:43:57Z")

</div>

Perfect! Thanks for the quick and clear reply @mcmcclur!
