CSS Best Practices: Table Tags

  • Use table tags for tabular data and not layout - Tables do not mix well with CSS and do not always render correctly in some browsers. The problem with this is that it is harder to implement advanced CSS layouts. Because of this even though it is the best practice to stick to CSS and avoid table tags you can still opt to use table tags if the project is on a tight schedule.
  • Group selectors that have the same CSS declarations - Instead of declaring each selector one at a time group them together. This will result in a cleaner code.
  • Use EM for font sizes - This should be done only if you won’t be using relative font sizes. If you are wondering why you shouldn’t use pixels instead especially since it is the more common choice of web designers the reason is that it is less accessible that EM due to that fact that IE does not resize pixels.
  • Avoid using Inline styles - I will discuss this in further depth on my next post. For now let’s just say that external style heets are better and also easier to use.

Go back