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 12-06-2005, 02:54 PM   PM User | #1
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
convert this table in to css layout

Hi everybody

How can I convert the pricing table down the right of this site - http://www.conveyancy.com/ into a non table div structure.

I cannot figure it out, other than to use a seperate div for each cell row.
KevinG is offline   Reply With Quote
Old 12-06-2005, 03:00 PM   PM User | #2
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
kevin, do you specifically want it to be non-tabled?

As far as I can tell, it is tabular data so, tabling it would keep the symantic bunch happy

Bazz.
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link
bazz is offline   Reply With Quote
Old 12-06-2005, 03:05 PM   PM User | #3
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
i drew a blank 2 col, 19 row table and then tried to style it with the colours and cell spacing etc but it would not render correctly.
KevinG is offline   Reply With Quote
Old 12-06-2005, 03:34 PM   PM User | #4
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
No reason to use a non-table approach for that. Tables are not the devil, lol. They're just not supposed to be used for designing the layout of the website. For data like you're displaying, tables are the perfect answer

-Shane
TheShaner is offline   Reply With Quote
Old 12-06-2005, 03:40 PM   PM User | #5
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
Thanks Shaner

(lucky sod - orlando)
KevinG is offline   Reply With Quote
Old 12-06-2005, 07:19 PM   PM User | #6
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
I have used this styling for my table:

#conveyancingtable{
background: #9966FF;
width: 385px;
text-align: center;
height: auto;

but my text appears in each cell crushed to the top and with about 10-15px of space underneath before the next cell begins. i want my text to appear in the middle of each cell both Hori and Vert.

i have tried assigning a height to each cell, that made no difference.
KevinG is offline   Reply With Quote
Old 12-06-2005, 08:41 PM   PM User | #7
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
Haha, Orlando's nice as long as you keep out of rush hour traffic lol

You need to include a padding of auto. This will pad your text evenly and center it both hor. and vert. in your cell. Also, is that class for the table or for your td's? Do something like this if that's for your table.
Code:
#conveyancingtable {
  background: #9966FF;
  width: 385px;
  text-align: center;
}
#conveyancingtable td{
  background: #9966FF;
  padding: auto;
  text-align: center;
}
This will set both the table and td background to the same color. And for the td's, all text will be centered.

Also, if you validate this CSS, you'll get warnings saying that you didn't specify a font color, so remember to do that.

-Shane
TheShaner is offline   Reply With Quote
Old 12-06-2005, 09:12 PM   PM User | #8
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
tried that, still same problem.

text is appearing centre on H, but vertically its appear top of cell

i have been to orlando twice, $2 breakfasts, boston lobster etc the best!
KevinG is offline   Reply With Quote
Old 12-06-2005, 09:17 PM   PM User | #9
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
padding:auto; doesn't work like you think it would try this
Code:
#conveyancingtable {
  background: #9966FF;
  width: 385px;
  margin:auto;
}
#conveyancingtable td{
  vertical-align:middle;
  text-align: center;
}
_Aerospace_Eng_ is offline   Reply With Quote
Old 12-06-2005, 09:18 PM   PM User | #10
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
You're not using valign in your table, are you? lol Maybe someone with better skills with CSS can help you out here. If anything, set a preferred padding on top and bottom instead of auto. Or if you don't want any padding, set it to 0.

Or hey, AE just came to the rescue, hehe. Forget my entry.

-Shane
TheShaner is offline   Reply With Quote
Old 12-06-2005, 09:50 PM   PM User | #11
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
nope, text in table cell although centred hori, is still appearing top vertically
KevinG is offline   Reply With Quote
Old 12-06-2005, 09:52 PM   PM User | #12
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
Is code available to look at? Would need to see the code for the table and the relevant CSS code that is being applied to it.

-Shane
TheShaner is offline   Reply With Quote
Old 12-06-2005, 10:23 PM   PM User | #13
KevinG
Regular Coder

 
KevinG's Avatar
 
Join Date: Aug 2002
Location: The Matrix
Posts: 405
Thanks: 3
Thanked 0 Times in 0 Posts
KevinG is an unknown quantity at this point
<table border="0" cellpadding="0" cellspacing="0" id="conveyancingtable">
<tr id="conveyancingtable">
<td><h5>Sale + Purchase Fees<br />
Property Price</h5></td>
<td bgcolor="#FFFFFF"><h5>Solicitor Fee<br />
(excluding vat &amp; costs)</h5></td>
</tr>
<tr>
<td><h5>121122</h5></td>
<td bgcolor="#FF0000"><h5>121122</h5></td>
</tr>
<tr>
<td><h5>121122</h5></td>
<td><h5>121122</h5></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>


-----------------
}

#conveyancingtable {
background: #9966FF;
width: 385px;
margin:auto;
}
#conveyancingtable td{
vertical-align:middle;
text-align: center;
}


-------------

i have never had this prob b4.
KevinG is offline   Reply With Quote
Old 12-06-2005, 11:17 PM   PM User | #14
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Well you used the same id twice. Once in the tr and once in the table. Take out the one in the tr. It works in Firefox as expected. IE doesn't like the idea of vertical aligning the h5's taking the text out of the h5 will make it work. I don't see the need for a header in your situation.
_Aerospace_Eng_ is offline   Reply With Quote
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 12:15 AM.


Advertisement
Log in to turn off these ads.