# [Usage](../../../usage.md) > Print HTML
You can print html using a front-end javascript function:

```javascript
kfwPrintHTML(html)
```

or:

```javascript
kfwPrintHTML(html, options)
```

This will pop-up the printing window in your browser. The options are:  

```javascript
const {
    baseHref = window.location.origin + "/",
    iframeWidth = "1200px",
    iframeHeight = "800px",
} = options;
```

_NOTE:_ this will create an iframe with html inside, be sure to not place inside the html any css that changes the print if not necessary.

### Example: print a card + table

```html
<div id="invoice">
    {!! \KFramework\Components\Visual\Card::make()->setTitle('Invoice #42') !!}
</div>

{!! \KFramework\Components\Visual\Button::make('Print')->setOnClick("kfwPrintHTML(document.getElementById('invoice').innerHTML)") !!}
```

With custom size:

```javascript
kfwPrintHTML(document.getElementById('invoice').innerHTML, {
    iframeWidth: '900px',
    iframeHeight: '600px',
    baseHref: window.location.origin + '/'
});
```

This pairs well with [Table printable](../../components/visuals/table/table_printable.md) (server-side table print) when you need a quick client-side print instead, and with [Print HTML] buttons inside a [Modal](../../components/visuals/modal.md).

---

See also: [Usage](../../../usage.md), [Table printable](../../components/visuals/table/table_printable.md), [Table downloadable](../../components/visuals/table/table_downloadable.md), [Button](../../components/visuals/button.md).