September 28, 200917 yr Hi Guys I'm trying to sort out the table for the packages but I'm having real trouble http://www.specialhosting.co.uk/hosting.html The data in the first column is stuck to the border !! I don't know how to make it unstuck. Also in Firefox I get something and in IE8 I get something totally different I want the table to look the same in both browsers .. Firefox and IE8. please help. Thank You.
September 28, 200917 yr Your left col is a th while the others are td, although they all have the same class="thcolalt" Add text-align: center; to the th style (the td style has it):- th { font-weight:normal; text-align: center; padding: 0.7em 0; border-right:1px solid #303030; border-left:1px solid #303030; border-bottom:1px solid #303030; border-top:1px solid #303030; }
September 28, 200917 yr And if IE8 is being a pain in the ass just add: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> below your <head> which will render as if in IE7.
September 28, 200917 yr Author @Wickham: I just did that .. but that just centers the text within the first column ! I didn't want it centered .. I just wanted a little padding to its left so that it wasn't touching the left border of the table Ohh by the way .. why is IE8 showing the text within that first column as centered even though I have added that text-align: center; to the th ??
September 29, 200917 yr First, let me point out that you're missing the opening table tag; your table code just has an ending table tag (</table>). When you add the opening table tag, you can use the cellpadding attribute to increase the amount of space within the cells. Here's what you should have: <table cellpadding="whatever"> <tr> <th width="28%"></th> <th width="18%"><h2 align="center">Basic</h2></th> <th width="18%"><h2 align="center">Advanced</h2></th> <th width="18%"><h2 align="center">Premium</h2></th> <th width="18%"><h2 align="center">Reseller</h2></th> </tr> <tr> <th class="thcolalt">Web Space</span></th> <td class="thcolalt"><strong>1,000 MB's</strong></td> <td class="thcolalt"><strong>3,000 MB's</strong></td> <td class="thcolalt"><strong>5,000 MB's</strong></td> <td class="thcolalt"><strong>15,000 MB's</strong></td> </tr> <tr> <th class="thcolalt">Bandwidth</th> <td class="thcolalt"><strong>3,000 MB's </strong></td> <td class="thcolalt"><strong>5,000 MB's</strong></td> <td class="thcolalt"><strong>10,000 MB's</strong></td> <td class="thcolalt"><strong>40,000 MB's</strong></td> </tr> <tr> <th class="thcol"><strong>Free</strong> UK Domain Name</th> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> </tr> <tr> <th>Domains you can host on Webspace </th> <td>1</td> <td>2</td> <td>10</td> <td>Unlimited</td> </tr> <tr> <th>Sub-Domains</th> <td><img src="images/cross.png" alt="none" width="32" height="32" /></td> <td>5</td> <td>25</td> <td>Unlimited</td> </tr> <tr> <th class="thcol">PHP 5 & MySQL 5 </th> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> </tr> <tr> <th>MySQL Databases </th> <td>1</td> <td>5</td> <td>25</td> <td>100</td> </tr> <tr> <th class="thcol">Email Accounts </th> <td>10</td> <td>100</td> <td>250</td> <td>Unlimited</td> </tr> <tr> <th>Web Site Builder</th> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> <td><img src="images/tick.png" alt="Included" /></td> </tr> <tr> <th>SSH Access </th> <td><img src="images/cross.png" alt="none" width="32" height="32" /></td> <td><img src="images/cross.png" alt="none" width="32" height="32" /></td> <td><img src="images/cross.png" alt="none" width="32" height="32" /></td> <td><img src="images/tick.png" alt="Included" /></td> </tr> <tr> <th class="thcol">Monthly Price </th> <td><strong>£1.99 / month</strong></td> <td><strong>£3.99 / month</strong></td> <td><strong>£4.99 / month</strong></td> <td><strong>£14.99 / month</strong></td> </tr> <tr> <th class="thcol"> </th> <td><div align="center"><a href="#"><img src="images/button2.jpg" alt="Sign Up Now" border="0" /></a></div></td> <td><div align="center"><a href="#"><img src="images/button2.jpg" alt="Sign Up Now" border="0" /></a></div></td> <td><div align="center"><a href="#"><img src="images/button2.jpg" alt="Sign Up Now" border="0" /></a></div></td> <td><div align="center"><a href="#"><img src="images/button2.jpg" alt="Sign Up Now" border="0" /></a></div></td> </tr> </table> Notice how I added the opening table tag at the very beginning of the code.
September 29, 200917 yr Author I've just checked my code ... I do have an opening tag for the table !! <table id="compareplans"> I managed to do the padding by the way ! But I still don't know why IE shows the text in the first column as Centered !! I do not want the text centered .. I want it on the left like in FireFox 3.5 I'd greatly appreciate any further help with this Thanks
September 29, 200917 yr If you don't want the left th column centered you could use cellpadding but that is the clumsy old method of coding which will affect the whole table. Stay with <table id="compareplans">. You already have top and bottom padding, just add side padding:- th { font-weight:normal; padding: 0.7em 20px; /*was 0.7em 0;*/ border-right:1px solid #303030; border-left:1px solid #303030; border-bottom:1px solid #303030; border-top:1px solid #303030; } That works in IE7 and should work in IE8. The id for the whole table has text-align: left; #compareplans { font-size: 1.4em; text-align:left; border-collapse:collapse; margin-left:auto;margin-right:auto; width:90%;} but that is overridden in the td style by text-align: center; It will apply to the th left column and then the padding edit will keep the text away from the left side.
September 29, 200917 yr Author Hi Wickham I just tried that .. but it didn't work ! So I decided to make a backup and play around with things !! Something I've never done before .. I'm always scared to mess stuff up. Anyways .. I managed to do it. Now I want IE to display the table the exact way that I want it displayed. check it out ! http://www.specialhosting.co.uk Thanks for all the help guys
September 29, 200917 yr On your hosting.html page the left column looks the same now in IE7, IE8 and Firefox with a small amount of padding on the left. You have done what I suggested with the revised style th { font-weight:normal; padding: 0.7em 0.5em; border-right:1px solid #181818; border-left:1px solid #181818; border-bottom:1px solid #181818; border-top:1px solid #181818; } using 0.5em instead of my 20px.
September 29, 200917 yr Author Yep but that on its own didn't work .. that is why I had to add some other classes to the CSS. Thanks for all the help Wickham
Create an account or sign in to comment