iT邦幫忙

1

JS 新增陣列 CSS :before 出現問題

  • 分享至 

  • twitterImage

https://codepen.io/ipphof/pen/gOYPBKR

請問為何 點新增第2個 tr
吃不到 CSS :before
第3個又正常... 這讓我好苦惱

https://ithelp.ithome.com.tw/upload/images/20190814/20110292z9SB3nh6po.jpg

https://ithelp.ithome.com.tw/upload/images/20190814/20110292qCgou1vrEm.jpg

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

2
dragonH
iT邦超人 5 級 ‧ 2019-08-14 12:20:02
最佳解答

codepen

我沒有細看你的 css 在做啥

有點亂 /images/emoticon/emoticon07.gif

不過我把

#rwdtable-2 #tab_logic2 tr:nth-child(2) td:before {
    display: none;
}

註解後就正常了

看更多先前的回應...收起先前的回應...
咖咖拉 iT邦好手 1 級 ‧ 2019-08-14 13:03:12 檢舉

這是我寫的
解決出問題的人 就沒問題了 /images/emoticon/emoticon07.gif

不是啦/images/emoticon/emoticon02.gif

這樣第2筆從資料庫撈的就不見了

那CSS 原本是寫手機的RWD表格

dragonH iT邦超人 5 級 ‧ 2019-08-14 13:22:20 檢舉

什麼第二筆資料?/images/emoticon/emoticon04.gif

所以你的問題不只新增不會套用 css 的意思嗎XD

咖咖拉 iT邦好手 1 級 ‧ 2019-08-14 13:26:52 檢舉

/images/emoticon/emoticon16.gif

這是前人寫的 其實我不知道他是用哪種套件寫的

dragonH iT邦超人 5 級 ‧ 2019-08-14 13:33:05 檢舉

那你可能要看一下

第2筆從資料庫撈的就不見了

的情況

css 發生了什麼事

咖咖拉 iT邦好手 1 級 ‧ 2019-08-14 13:38:55 檢舉

誤會誤會~~
不是不見

#rwdtable-2 #tab_logic2 tr:nth-child(2) td:before {
    display: none;
}

是 會把第2個tr 隱藏
第2個tr 裡面資料還是會正常撈出來

我把codepen 預設有3筆資料了

dragonH iT邦超人 5 級 ‧ 2019-08-14 13:45:04 檢舉

codepen

那就把 :before 拿掉你覺得怎麼樣/images/emoticon/emoticon11.gif

咖咖拉 iT邦好手 1 級 ‧ 2019-08-14 13:51:21 檢舉

/images/emoticon/emoticon04.gif

我了解了 謝謝大大....原來是這樣

dragonH iT邦超人 5 級 ‧ 2019-08-14 13:53:12 檢舉

/images/emoticon/emoticon82.gif

咖咖拉 iT邦好手 1 級 ‧ 2019-08-14 13:54:30 檢舉

/images/emoticon/emoticon16.gif

我要發表回答

立即登入回答