According to the rules for written work at my university, a table or figure cannot divide a paragraph. In the following MWE, the table doesn't fit on the first page and is therefore placed on the second page. This is fine, but the following paragraph is split by the positioning of the table. Ideally, the table should appear after this split paragraph, or the split paragraph should appear after the table. How can I do this in general, as this situation is often repeated in my text?
\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\begin{document}
\blindtext[3]\par
Text text \textbf{The table should appear here, avoiding splitting the paragraph. According to the rules for my work, paragraphs should be complete, either before or after tables and figures.}\par
\begin{table}[h!]
\centering
\caption{The caption}
\begin{tabular}{|c|c|}
\hline
& \
\hline
1 & 7 \
\hline
2 & 77 \
\hline
3 & 777 \
\hline
4 & 777 \
\hline
5 & 7777 \
\hline
\end{tabular}
\end{table}
\blindtext\par
\end{document}

[h]option. Start at the beginning of the file, and reprocess after every change -- the vertical spacing will change (more extra space in the middle of a page than at top or bottom), so paragraphs that were broken in an earlier run may not break after rearrangement. Also consider the use of\enlargethispageand\loosenessif only one or two lines are broken to a new page. – barbara beeton Sep 20 '23 at 21:20[H]option with thefloatpackage, but if it doesn't fit, the table have no more option that move to the next page, so leaving a horrible space on the previous page, since you do not allow to fill it with the text after the table. Therefore, it wll be your work rewrite the text to avoid the gaps. – Fran Sep 21 '23 at 09:29\clearpage. Also, [h!] rartely differs from [h]; it does NOT mean "try harder." – John Kormylo Sep 21 '23 at 14:53