diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index f1b0087f9be..75e55801864 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1899,20 +1899,21 @@ The preference is a float determined from `shr-prefer-media-type'."
(when (zerop shr-table-depth)
(save-excursion
(shr-expand-alignments start (point)))
- (save-restriction
- (narrow-to-region (point) (point))
- (insert (mapconcat #'identity
- (shr-collect-extra-strings-in-table dom)
- "\n"))
- (shr-fill-lines (point-min) (point-max))))))
+ (let ((strings (shr-collect-extra-strings-in-table dom)))
+ (when strings
+ (save-restriction
+ (narrow-to-region (point) (point))
+ (insert (mapconcat #'identity strings "\n"))
+ (shr-fill-lines (point-min) (point-max))))))))
(defun shr-collect-extra-strings-in-table (dom &optional flags)
"Return extra strings in DOM of which the root is a table clause.
Render
s and