jaymc Posted April 1, 2008 Share Posted April 1, 2008 Im trying to make the HTML on my website as compliant as possible My question is, should be used to generate padding? In my case, Im using it as a way of padding rather than using CSS or cellpadding=1 Using is much easier, but could this cause problems? I suppose its better than using the old, 1px transparent pixel, but should I really be doing this in CSS even though that will in itself mean more classes and drive me mad! Quote Link to comment Share on other sites More sharing options...
Helmet Posted April 1, 2008 Share Posted April 1, 2008 you don't necessarily need more classes... try: td, andwhateverelse { padding: 5px } yes you should be padding your cells with css rather than unless you want to have to go find all those 's one day and remove them manually during a redesign. Quote Link to comment Share on other sites More sharing options...
haku Posted April 2, 2008 Share Posted April 2, 2008 The only time you should be using   is when you have a table that is filled with tabular information (i.e. not page layout), but has an empty cell in it. Most browsers render fine without the $nbsp, but some need some content in that cell. Quote Link to comment Share on other sites More sharing options...
Guardian-Mage Posted April 2, 2008 Share Posted April 2, 2008 you would be better off using CSS Padding and/or Margins: padding: top right bottom left; Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted April 2, 2008 Share Posted April 2, 2008 don't ever use , unless it's an empty cell in a table. - Very rare. The problem with your idea, is that this will actually be text. So when some highlights all the code, they highlight, "blankness." Remember CSS was created for visuals, pure html is supposed to be only used for content. Quote Link to comment Share on other sites More sharing options...
jaymc Posted April 4, 2008 Author Share Posted April 4, 2008 The problem is I need different padding for different area sometimes 1px to the left, others 2px to the left 5px to the right So its not as if I can just add it into one class Im either going to have about 20 css classes, or put style="padding-left:2px" for example in a lot of cells Still think to go with doing that? Quote Link to comment Share on other sites More sharing options...
haku Posted April 4, 2008 Share Posted April 4, 2008 Yep! Mark-up shouldn't have any presentation in it, and using nbsp is trying to style with your markup. It should be avoided. Quote Link to comment Share on other sites More sharing options...
jaymc Posted April 5, 2008 Author Share Posted April 5, 2008 Yep! Mark-up shouldn't have any presentation in it, and using nbsp is trying to style with your markup. It should be avoided. Hmm, so what if there is some text that I want underlined and bold, would you create a css class just for that or use the <b><u> tags same theory goes for aligning and text colouring, if its only going to be used for one string of text on the whole site, is it worth that class or just putting a style="..." in the tag I just dont want to be adding 50 classes to sort out 50 seperate bits of text / position etc as they will only be used once Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted April 6, 2008 Share Posted April 6, 2008 50 css classes? Maybe you are doing something wrong. You should use classes that inherent properties from their parent div's... Explain what you are trying to do. Either way, you will end up using css. Using html to style is ridiculous. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.