开发者

applying css class dynamically to table td not working in firefox

开发者 https://www.devze.com 2023-03-10 09:23 出处:网络
I want to add css class to td which is created dynamically 开发者_StackOverflow社区and this is portion of my code

I want to add css class to td which is created dynamically 开发者_StackOverflow社区and this is portion of my code

var newTD = document.createElement("td");

td is created but border is not coming. td is added into table properly when user clicks on plus button.css is not applied.

css class is

table.ms_grid td, table.ms_grid table td
{
padding: 3px 5px;
border: 1px #D3E4F5 solid;
cursor: pointer;
}

this code is part of my project

please suggest solution.


Most table cell borders won't display unless there's something within.

The old method was to add a   inside however I believe there's a CSS property to always show borders. Will edit if I find it.

There it is, empty-cells, supported in everything (current) except IE7 and below

0

精彩评论

暂无评论...
验证码 换一张
取 消