# Inputs.table formatting columns

**URL:** <https://talk.observablehq.com/t/inputs-table-formatting-columns/6032>\
**Category:** Help\
**Created:** [January 4, 2022, 12:07am UTC](https://talk.observablehq.com/t/inputs-table-formatting-columns/6032 "2022-01-04T00:07:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Dennis](https://talk.observablehq.com/u/Dennis)\
**Post date:** [January 4, 2022, 12:07am UTC](https://talk.observablehq.com/t/inputs-table-formatting-columns/6032/1 "2022-01-04T00:07:35Z")

</div>

When I use printTable(data), I get a compact format and the column values are complete. But when I use Inputs.table(data, …), some columns are very wide with whitespace, and other column values are truncated (with a … suffix) . How do I resolve these formatting issues?

---

<div class="post-metadata">

**Author:** ![tophtucker](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tophtucker/32/4781_2.png) [@tophtucker](https://talk.observablehq.com/u/tophtucker)\
**Post date:** [January 4, 2022, 1:20am UTC](https://talk.observablehq.com/t/inputs-table-formatting-columns/6032/2 "2022-01-04T01:20:00Z")

</div>

I assume you’re referring to the `printTable` from [Data Utilities / UW Interactive Data Lab / Observable](https://observablehq.com/@uwdata/data-utilities)? (This forum covers all Observable users, and anyone could write a printTable function, so I’m just kinda guessing you’re using a popular one!)

You can switch the Inputs.table layout between auto (columns are sized wider/narrower according to contents) and fixed (all columns are the same size) like this:

```javascript
Inputs.table(data, {layout: "auto"})
Inputs.table(data, {layout: "fixed"})

```

It defaults to `layout: "fixed"` for ≤12 columns, so I suspect that’s what you’re seeing; I think printTable always uses `layout: "auto"` (which is the [generic CSS default](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout) for HTML tables, not specific to either of these JavaScript functions for making tables from arrays of objects).

You can also define formatters for individual columns if they’re blowin up the layout. E.g., to truncate the `bio` column to 40 characters:

```javascript
Inputs.table(data, {format: {bio: d => d.substring(0, 40)}})

```

In general it’s hard to come up with one set of formatting guidelines that work for all tables. If you post a specific example I may be able to give more specific help.
