我有<td>
嵌套<p>
。当文本超过最大长度时,它会从右到左打印新行上的剩余文本。
如何修复此问题,以便新行从右到左开始打印? 这是我的代码:
.group {
border: 2px solid #FFCC00;
min-width: 250px;
width: 32.85%;
margin-bottom: 5px;
margin-left: 5px;
padding: 3px;
float: left;
}
.group article {
padding: 5px;
max-height: 350px;
overflow: auto;
}
.group article table {
width: 100%;
border-spacing: 7px;
}
&#13;
<div class="group">
<article>
<header> Links</header>
<hr/>
<section>
<table>
<tbody>
<tr>
<td>
<p><a href="example.com/" target="_blank">Click here</a></p>
</td>
<td>
<p>Description </p>
</td>
</tr>
</tbody>
</table>
</section>
</article>
</div>
&#13;
答案 0 :(得分:1)
使用:
text-align: right;
根据您的示例,将文本对齐到右侧。
.group {
border: 2px solid #FFCC00;
min-width: 250px;
width: 32.85%;
margin-bottom: 5px;
margin-left: 5px;
padding: 3px;
float: left;
}
.group article {
padding: 5px;
max-height: 350px;
overflow: auto;
}
.group article table {
width: 100%;
border-spacing: 7px;
}
td.right p{
text-align:right;
}
&#13;
<div class="group">
<article>
<header> Links</header>
<hr/>
<section>
<table>
<tbody>
<tr>
<td>
<p><a href="example.com/" target="_blank">Click here</a></p>
</td>
<td class="right">
<p>Description lorem ipsum dollar sit amet</p>
</td>
</tr>
</tbody>
</table>
</section>
</article>
</div>
&#13;