gpt4 book ai didi

jquery - 如何给第一行数据加粗字体?

转载 作者:行者123 更新时间:2023-11-28 09:12:54 27 4
gpt4 key购买 nike

我有一个具有自动完成功能的文本框,它以表格格式填充数据。我希望第一行数据为粗体。

我的代码:

   .data("autocomplete")._renderItem = function (ul, item) {
return $("<li></li>").data("item.autocomplete", item).append("<a><table><tr><td width='200px'>" + item.label + "</td>" + "<td width='110px'>" + item.val.split('~')[6] + "</td>" + "<td>" + item.val.split('~')[4] + "</td></tr></table></a>").appendTo(ul);
};

最佳答案

JS:

$('table tr:first').css('font-weight','bold');

jQuery 选择器找到表的第一个 tr :- tr:first

只需在您的代码后添加这一行即可。

将这些行添加到您的 css/style 标签中。

table tr:first-child {
font-weight:bold;
}

关于jquery - 如何给第一行数据加粗字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23752228/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com