td에 다른 텍스트 색상을 적용하고 있지만 마지막에 색상을 적용하면 td 이상의 모든 색상이 변경됩니다. 예 : 아래 코드에서 마지막 행은 빨간색이고,이 행을 실행 한 후 td 위의 색도 빨간색으로 변경됩니다. 이 문제로 어떻게 극복해야합니까? // HTMLtd에 다른 색상으로 색상 적용
'<table class="ui-widget" width="100%" border="0" cellspacing="1" cellpadding="2">'+
'<thead class="ui-widget-header" id="orderListHead">'+
'<tr>'+
'<th><strong> Order# </strong></th>'+
'<th><strong> Exchange </strong></th>'+
'</tr>'+
'</thead>'+
'<tbody id="orderListBody">'+
'</tbody>'+
'</table>'+
if(orderList== "Buy"){
$("#orderListBody",this.orderListTable)
.append('<tr><td>'+orderList.ORDER_NUMBER+'</td><td>'+orderList.SHORT_NAME+'</td></tr>')
.css("color","green");
}
if(orderList == "Sell"){
$("#orderListBody",this.orderListTable)
.append('<tr><td>'+orderList.ORDER_NUMBER+'</td><td>'+orderList.SHORT_NAME+'</td></tr>')
.css("color","red");
}
를 추가하려면 html 코드 위의 스크립트와 관련하여 – run
특정'td'가 아닌'# orderListBody'에 CSS를 추가하고 있습니다 – diEcho