Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-04-2013, 06:27 PM   PM User | #1
mzpresto
New Coder

 
Join Date: Aug 2012
Posts: 45
Thanks: 15
Thanked 0 Times in 0 Posts
mzpresto is an unknown quantity at this point
Tabbed spacing HTML/CSS Best practice?

Hi

I was wondering what the best practice is to do tabbed spaces in HTML / CSS for stuff like menus, opening times, contact detail etc.

If I "paste special" in dreamweaver it kind of works, although not accross browsers and it is just adding loads of &nbsp tags for every space... Not a good method I am sure.

How would you line this up for example so it was tabbed:


Email: enquiries@ecofrost-uk.com

Phone: 01274 649720

Mobile: 07531712315

Address: 4 Mendip Way
Bradford
West Yorkshire
BD12 0ED

Would you make 2 divs?

This is how it looks at the moment, the address is not lined up properly:

http://vicarscafebistro.co.uk/website/contact.html

This is the horrendously messy code I have at the moment

Code:
<div class="text"> 
<p><img src="Contact.jpg" alt="Contact us" width="139" height="37" /></p> 
<p>&nbsp;</p> 
<p>Email:&nbsp;&nbsp;&nbsp;          <a href="mailto:enquiries@ecofrost-uk.com">enquiries@ecofrost-uk.com</a></p> 
<p>&nbsp;</p> 
<p>Phone:&nbsp;         01274 649720</p> 
<p>&nbsp;</p> 
<p>Mobile:&nbsp;         07531712315</p> 
<p>&nbsp;</p> 
 
<p>Address:&nbsp;      4  Mendip Way<br /> 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Bradford<br /> 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  West Yorkshire<br /> 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  BD12 0ED</p> 
<!-- end .text --></div>
Thanks in advance
mzpresto is offline   Reply With Quote
Old 02-04-2013, 07:08 PM   PM User | #2
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 892
Thanks: 4
Thanked 206 Times in 205 Posts
tracknut is an unknown quantity at this point
To me, it fits within the definition of "tabular data" and I would put it in a table.

Dave
tracknut is offline   Reply With Quote
Users who have thanked tracknut for this post:
mzpresto (02-10-2013)
Old 02-04-2013, 07:11 PM   PM User | #3
mzpresto
New Coder

 
Join Date: Aug 2012
Posts: 45
Thanks: 15
Thanked 0 Times in 0 Posts
mzpresto is an unknown quantity at this point
Cool yeah I can do that, I was just trying to avoid tables at all costs, and wondered if there was a CSS way, but I guess for some stuff you just need tables

What are the DT and DD tabs? I heard something about them once?

Thanks
mzpresto is offline   Reply With Quote
Old 02-04-2013, 07:24 PM   PM User | #4
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 892
Thanks: 4
Thanked 206 Times in 205 Posts
tracknut is an unknown quantity at this point
Quote:
Originally Posted by mzpresto View Post
Cool yeah I can do that, I was just trying to avoid tables at all costs, and wondered if there was a CSS way, but I guess for some stuff you just need tables
Not the right move, IMO. Tables are a fundamental part of html, not something to be avoided at all costs. They should be used when you are displaying tabular data, and they should be styled with css.

Quote:
What are the DT and DD tabs? I heard something about them once?

Thanks
Definitions lists - you could get the layout you want with a definition list, but semantically I don't think you've got a list of "definitions" here.

Dave
tracknut is offline   Reply With Quote
Users who have thanked tracknut for this post:
mzpresto (02-10-2013)
Old 02-04-2013, 07:46 PM   PM User | #5
mzpresto
New Coder

 
Join Date: Aug 2012
Posts: 45
Thanks: 15
Thanked 0 Times in 0 Posts
mzpresto is an unknown quantity at this point
Thanks tracknut, I thought I was failing by using tables and going for the easy way out lol!

I'll add them to a table, it makes sense
mzpresto is offline   Reply With Quote
Old 02-04-2013, 11:04 PM   PM User | #6
alliv105
New Coder

 
Join Date: Jan 2013
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
alliv105 is an unknown quantity at this point
Really depends on the exact "look" or "format" you need. If you want the second column to be aligned in every row (starting from the same horizontal position), using the table is the easiest way. But since using tables in html are generally frowned upon, you can use div's with with width's that you need. That's probably the best way, and you won't have to worry about tabbed spaces since you can set the paddings.
__________________
Owner of online bath hardware and accessories store, selling bathroom accessory sets | Blog.
alliv105 is offline   Reply With Quote
Users who have thanked alliv105 for this post:
mzpresto (02-10-2013)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:11 PM.


Advertisement
Log in to turn off these ads.