Html 我们如何仅加粗表 td 标记中的名称而不加粗值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6379930/
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 09:08:47  来源:igfitidea点击:

How we can bold only the name in table td tag not the value

htmlhtml-table

提问by arsenal

Is there any way that I can make CC Quid, Application Number, Application Title and in the same way other thing in bold, I don't want their value to be in bold. Any suggestions will be appreciated..

有什么方法可以使 CC Quid、申请号、申请标题以及其他以粗体显示的内容相同,我不希望它们的值以粗体显示。任何建议将不胜感激..

html = html + "<table border ='0'>";
    html= html + "<tr>";
    html =html + "<td>CC Quid: " +(data.response.docs[0].c_cc_guid)+"</td></tr>";
    html =html + "<tr><td>Application Number: " +(data.response.docs[0].c_application_number)+"</td></tr>";
    html =html + "<tr><td>Application Title: " +(data.response.docs[0].c_application_title)+"</td></tr>";
    html =html + "<tr><td>Application Type Name: " +(data.response.docs[0].c_application_type_name)+"</td></tr>";
    html =html + "<tr><td>Case Mgr Name: " +(data.response.docs[0].c_case_mgr_name)+"</td></tr>";
    html =html + "<tr><td>Filed Date: " +(data.response.docs[0].c_filed_date)+"</td></tr>";
    html =html + "<tr><td>Lead Atny Name: " +(data.response.docs[0].c_lead_atny_name)+"</td></tr>";
    html =html + "</table>";

回答by Ord

Surround what you want to be bold with:

围绕您想要大胆的内容:

<span style="font-weight:bold">Your bold text</span>

This would go inside your <td>tag.

这将进入您的<td>标签。

回答by kinakuta

Wrap the name in a span, give it a class and assign a style to that class:

将名称包装在一个跨度中,给它一个类并为该类分配一个样式:

<td><span class="names">Name text you want bold</span> rest of your text</td>

style:

风格:

.names { font-weight: bold; }

回答by inkedmn

I might be misunderstanding your question, so apologies if I am.

我可能误解了你的问题,如果我是,请道歉。

If you're looking for the words "Quid", "Application Number", etc. to be bold, just wrap them in <strong>tags:

如果您希望将“Quid”、“Application Number”等字样加粗,只需将它们包装在<strong>标签中:

<strong>Quid</strong>: ...

Hope that helps!

希望有帮助!

回答by Muhammad Aamir Ali

you can try this

你可以试试这个

td.setAttribute("style", "font-weight:bold");

回答by Sandeep Suthar

Try this

尝试这个

.Bold { font-weight: bold; }
<span> normal text</span> <br>
<span class="Bold"> bold text</span> <br>
<span> normal text</span> <spanspan>

回答by ahmed

I would use to table header tag below for a text in a table to make it standout from the rest of the table content.

我会使用下面的表格标题标签作为表格中的文本,使其从表格内容的其余部分中脱颖而出。

 <table>

    <tr>
     <th>Dimension:</th>
    <td>98cm x 71cm</td>
    </tr>
   </table