[英]If I have text in a cell within a table, how can I add text to the same cell just aligned to the far right of the cell?
If I have text in a cell within a table (that is automatically aligned to the left, which is fine), how can I also add text to the same cell just aligned to the far right of that cell?如果我在表格内的单元格中有文本(自动向左对齐,这很好),我怎样才能将文本添加到与该单元格最右侧对齐的同一个单元格中?
For example, the HTML code below, I need to add an asterisk to the very far right of the cell that currently reads " <td>Ctrl ⌘ N</td>
" .例如,下面的 HTML 代码,我需要在当前显示为“
<td>Ctrl ⌘ N</td>
”的单元格的最右侧添加一个星号。 How can I do this?我怎样才能做到这一点?
<table class="shortcutTable">
<tbody>
<tr>
<th class="narrow" lang="en">Shortcut</th>
<th lang="en">Action</th>
</tr>
<tr>
<td>Ctrl ⌘ N</td>
<td lang="en">Quick Note</td>
</tr>
The CSS float property will do what you want. CSS float 属性会做你想做的。 If you have a CSS file already linked in your page, you can make a class for it, but if you just want to put it right in with the HTML, try:
如果您的页面中已经链接了一个 CSS 文件,您可以为它创建一个类,但如果您只想将其与 HTML 一起放入,请尝试:
<td>Ctrl ⌘ N<span style="float: right">*</span></td>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.