diff options
author | Carson Gross <carson@bigsky.software> | 2023-12-24 14:55:11 -0700 |
---|---|---|
committer | Carson Gross <carson@bigsky.software> | 2023-12-24 14:55:11 -0700 |
commit | 42668c6df732edc0a0d4fdab05f4f3134042f7a7 (patch) | |
tree | 71df2887c4acad71622ed2cb3465a6341c8df7ce /www/content/attributes | |
parent | 291cc1ee7dbb29fc106de4c6f5d317d65527b196 (diff) | |
parent | 23d473291dc432d62d0e55ca84a7c10135b7e180 (diff) | |
download | htmx-42668c6df732edc0a0d4fdab05f4f3134042f7a7.tar.gz htmx-42668c6df732edc0a0d4fdab05f4f3134042f7a7.zip |
Merge branch 'v2.0v2.0' into disable-inheritance
# Conflicts:
# src/htmx.js
# www/content/docs.md
Diffstat (limited to 'www/content/attributes')
-rw-r--r-- | www/content/attributes/hx-swap-oob.md | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/www/content/attributes/hx-swap-oob.md b/www/content/attributes/hx-swap-oob.md index 0af9bbbf..79666f38 100644 --- a/www/content/attributes/hx-swap-oob.md +++ b/www/content/attributes/hx-swap-oob.md @@ -31,7 +31,26 @@ If a swap value is given, that swap strategy will be used. If a selector is given, all elements matched by that selector will be swapped. If not, the element with an ID matching the new content will be swapped. +### Troublesome Tables + +Note that you can use a `template` tag to encapsulate types of elements that, by the HTML spec, can't stand on their own in the +DOM (`<tr>`, `<td>`, `<th>`, `<thead>`, `<tbody>`, `<tfoot>`, `<colgroup>`, `<caption>` & `<col>`). + +Here is an example with an out of band swap of a table row being encapsulated in this way: + +```html +<div> + ... +</div> +<template> + <tr id="row" hx-swap-oob="true"> + ... + </tr> +</template> +``` + +Note that these template tags will be removed from the final content of the page. + ## Notes * `hx-swap-oob` is not inherited -* Out of band elements must be in the top level of the response, and not children of the top level elements. |