我有一个表格,无论浏览器是否放大,我都想在其中显示段落的原样。例如,在下图中:
第一段的最后一行应该始终以“突然她要和这个人回去了。”第二段的最后一行应该只包含最后一个词,< em>“回来。”。我希望它保持这种状态,因为我想稍后在左侧添加一个包含行号的列。
现在发生的情况是,当我使用 Web 浏览器 (Google Chrome) 放大或缩小时,文字往往会移动并换行到下一行,从而破坏了段落的恒定状态。
<table>
<tbody>
<tr>
<td width="422px">
<p style="text-align: justify; font-size: medium; font-family: 'Century Gothic',futura;">My biking beginnings can be summed up in two words: teenage love. My first girlfriend was small with mousy blonde hair and I was mad about her. Our romance came to an abrupt end however, when she started going out with another guy in my hometown, Crieff. He rode a 50 cc road bike first and then a 125. And whereas I had always walked my girlfriend home, suddenly she was going back with this guy.</p>
<p style="text-align: justify; font-size: medium; font-family: 'Century Gothic',futura;">I was nearly sixteen by then and already heartbroken. Then one day, on the way back from a shopping trip to Perth with my mum, we passed Buchan's, the local bike shop. I urged my mother to stop the car. I got out, walked up the short hill to the shop and pressed my nose to the window. There was a light blue 50cc bike on display right at the front of the shop. I didn't know what make it was, or if it was any good. Such trivialities were irrelevant to me. All I knew was that I could get it in three or four months time when I was sixteen and allowed to ride it. Maybe I could even get my girlfriend back.</p>
</td>
</tr>
</tbody>
</table>
最佳答案
您可以对段落使用white-space: pre
样式,但您的文本应该分成几行。现在每个段落都在一行中。
关于html - 当浏览器放大/缩小时,如何防止表格 <TD> 部分内的文本换行(移动)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20042466/