I'm using ~ to create indentation in a tabularx table. When space runs LaTeX take two lines which is fine but could be prettier.
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{0.3\textwidth}{@{}Xccc}
\hline
City & Number\
\hline
\textbf{Group 1}\
~~~ Khatmandu & 2\\ % I'm aware of the typo but already pasted the screenshots
\textbf{Group 2}\\
~~~ Beijing & 14 \\
\hline
\end{tabularx}
\end{document}
</code></pre>
<p>The outcome is</p>
<p><a href="https://i.stack.imgur.com/uoGr1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uoGr1.png" alt="enter image description here" /></a></p>
<p>But I would rather have either of the following</p>
<p><a href="https://i.stack.imgur.com/yxejL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yxejL.png" alt="enter image description here" /></a></p>
<p><strong>EDIT</strong>: The tables are produced by an external script so the best solution would be fully automatable.</p>
<p>Any ideas appreciated.</p>




