如何为附加函数添加样式


How to add style to append function

我想改变font &为append函数中的内容设置content align='center'。内容是从数据库&在数组中。请帮助!

currentrow
    .find('td')
    .next()
    .css('background-color', 'red')
    .addClass('active')
    .attr("title", namearray[j])
    .append(namearray[j]);

给你,

http://codepen.io/mkdizajn/pen/pJVWem?编辑= 101

希望这能解决问题。

我认为关键的部分是:

$('table tr')
    .eq(1) // find second row for ex..
    .find('td').eq(1) // find second cell for ex..
    .css('background-color', 'red') // give it some color
    .addClass('active').attr("title", 'mirko').css('text-align', 'center') // center position
;

hth