diff --git a/layouts/shortcodes/bootstrap-table.html b/layouts/shortcodes/bootstrap-table.html
index 9489b8ac..8981d39f 100644
--- a/layouts/shortcodes/bootstrap-table.html
+++ b/layouts/shortcodes/bootstrap-table.html
@@ -1,8 +1,11 @@
{{ $htmlTable := .Inner | markdownify }}
{{ $class := .Get 0 }}
-{{ $old := "
" }}
-{{ $new := printf "" $class "table-v1" }}
-{{ $htmlTable := replace $htmlTable $old $new }}
+{{ $oldTable := "" }}
+{{ $newTable := printf "" $class "table-v1" }}
+{{ $oldP := "" }}
+{{ $newP := printf "
" "table-v1"}}
+{{ $htmlTable := replace $htmlTable $oldTable $newTable }}
+{{ $htmlTable := replace $htmlTable $oldP $newP }}
{{ $htmlTable | safeHTML }}