Board logo

標題: [發問] 詢問javascript function 內的樣式套用 [打印本頁]

作者: mark15jill    時間: 2023-12-28 14:32     標題: 詢問javascript function 內的樣式套用

如果 css中有設定  .tb{font-size:1.25em;color:#f00;}

想詢問要怎樣在 function 中的 table 或是tr td  套用樣式 ( .tb )
  1.                         var html = '<table border=1 width=100% style=white-space: normal;font-size:1em;>';//
  2.                                                                   html  += '<tr >';//
  3.                                                                           for (j=1 ; j<5; j++){
  4.                                                                                 html+=        '<td>'+obj[0].data[j]+'</td>';
  5.                                                                         }
  6.                                                                           for (j=6; j<9; j++){
  7.                                                                                 html+=        '<td>'+obj[0].data[j]+'</td>';
  8.                                                                         }
  9.                                           
  10.                                 html  += '</tr>';                
複製代碼

作者: mark15jill    時間: 2024-1-2 10:32

如果 css中有設定  .tb{font-size:1.25em;color:#f00;}

想詢問要怎樣在 function 中的 table 或是tr td ...
mark15jill 發表於 2023-12-28 14:32



問題解決了... 自己亂測試出來的

跟內容當中套用樣式同樣方法




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)