Post History
We publish documentation online using HTML. For things like fixed parameter names and other code literals, we use <code> tags. My question is about styling these in tables. On our referenc...
#1: Initial revision
HTML tags versus CSS classes: is one preferred over the other for the same styling?
We publish documentation online using HTML. For things like fixed parameter names and other code literals, we use `<code>` tags. My question is about styling these in tables. On our reference pages, we list parameters in tables -- parameter name in the first column, description in another. I have been using `<code>` tags there (inside the `<td>`), same as in running text -- it's a semantic tag of sorts, so this makes sense to me. But HTML wasn't my first markup language, and maybe that's a habit I picked up from SGML before it. Recently I have discovered that someone else on the team is instead formatting those parameter cells as `<td class="code">`, and apparently we have CSS that supports that. (We're using a tool; we didn't write all our CSS from scratch.) Assuming that the cell contains one parameter and nothing else (like a list of parameters or parenthetical notes), so it looks the same to the reader, is there a reason to prefer one approach over the other? Both can be styled; is one more efficient or versatile than the other? I'd like us to pick one approach and all do it, to make maintenance easier, and I'm wondering if this is "six of one, half dozen of the other" or if there are good reasons for one over the other.