Replies: 4 comments
-
I'm no expert but I think cell-padding attribute will get the most consistent experience cross browser. If the desire is to keep using CSS I'd make this selector: .my_table--special-case td {
padding: 10px;
} |
Beta Was this translation helpful? Give feedback.
-
Hi, isn't against the BEM principle to use "td" selector? |
Beta Was this translation helpful? Give feedback.
-
In my opinion it's not "against" BEM to use an HTML tag in a selector. I think That's why I favored a |
Beta Was this translation helpful? Give feedback.
-
I'd say it falls around the same context portrayed here: http://getbem.com/faq/#block-modifier-affects-elements However, If you are writing your table dynamically, I'd use |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using a table and I'd like all "td" to have a padding of "10px" and I don't want to use the "cellpadding" attribute of the table. In "normal" CSS, I would do something like :
td { padding:10px; }
But I'd like to use BEM. What I did so far is :
.my-table__col { padding:10px; }
It works, but it means that I have to put this class on every "td" element of my array, which produce a HTML bigger than wanted. Is it the only solution or can I use "tag" selector in BEM (I think I read that I shouldn't...).
Beta Was this translation helpful? Give feedback.
All reactions