在 html table <td> 中加粗一行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10811351/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 00:42:50  来源:igfitidea点击:

Bold a single line in html table <td>

htmlcss

提问by Harikrishnan

I have used the following code to make a table but in the tag i only need the XYZ to be bold and all others to be unbold. But when I used this code the whole is going bold. I don't wish to use a css style sheet with this file. Someone please tell me how I can achieve this.

我使用以下代码制作表格,但在标签中,我只需要 XYZ 为粗体,其他所有为非粗体。但是当我使用这段代码时,整个过程都变得大胆了。我不想在这个文件中使用 css 样式表。有人请告诉我如何实现这一目标。

<table width=100%>
<tr>
<td><center><b>XYZ<b><br>Aabc<br>+91-xxxxxxxxx<br>[email protected]<center></td>
</tr>
</table>

Thanks in advance.

提前致谢。

采纳答案by Oskar Berggren

  1. You should use a style sheet.
  2. There is a simple typo: The / is missing in the second occurrence of <b>.
  1. 您应该使用样式表。
  2. 有一个简单的错字:第二次出现<b>.

回答by Stefan

<table style='width:100%;'>
    <tr>
        <td style='text-align:center;'>
            <span style='font-weight:bold;'>XYZ</span><br>
            Aabc<br>
            +91-xxxxxxxxx<br>
            [email protected]</td>
    </tr>
 </table>

http://jsfiddle.net/n5WZt/

http://jsfiddle.net/n5WZt/

回答by CSS Guy

please close your all tag

请关闭您的所有标签

<table width=100%>
<tr height=11%>
<td><center><b>XYZ</b><br>Aabc<br>+91-xxxxxxxxx<br>[email protected]</center></td>
</tr>
</table>

回答by Someth Victory

You got wrong spelling in HTML tag, close b tag forgot /, try this:

你在 HTML 标签中拼写错误,关闭 b 标签忘记 /,试试这个:

<table width=100%>
  <tr>
    <td><center><b>XYZ</b><br>Aabc<br>+91-xxxxxxxxx<br>[email protected]<center></td>
  </tr>
</table>