Welcome Guest ( Log In | Register )




                Web Hosting Guide

 
Reply to this topicNew Topic
Some Odd Things With Html Tables
sparkx
post Jun 22 2007, 05:41 PM
Post #1


Sparkx
Group Icon

Group: [HOSTED]
Posts: 376
Joined: 11-October 06
From: Dana Point, CA, USA
Member No.: 16,496
myCENTs:55.07


OK well this is making me mad. Maby it is the fact that I am in the middle of an awsome php project or it is because I am being outsmarted by html. Anyway I have this real odd thing occuring while I am programming. It is a little hard to explain, but when I put RE or RE: in a table cell, the next cell has an offset. Here is an example: Example. Now I have tried changing all the vars (for css ect) I keep getting the same error. Here is the code I used (simplified for post but the error still occurs):
CODE
<style type="text/css">
.var{
width: 600px;
}
</style>
<table class='var'><tr><td colspan='2'><center>RE  This is one cool forum.</center></td></tr>
<tr><td width="100" align="left">Dylan<br>
Posts: 10</td><td align="left" valign='top'><p align='left'>Me to.</p>
</td></tr></table>

I tried other browsers and that doent fix it. Does anyone have any suggestions?
Thanks,
Sparkx
Go to the top of the page
 
+Quote Post
FirefoxRocks
post Jun 22 2007, 06:40 PM
Post #2


Super Member
Group Icon

Group: [HOSTED]
Posts: 875
Joined: 12-July 06
From: Ontario, Canada
Member No.: 14,464
myCENTs:89.55


Your example link is broken and your subdomain is inaccessible with a HTTP 403 error.
Try not to use Transitional XHTML, use CSS and Strict XHTML instead. So your table could be like this:
HTML
<style type="text/css">
.var{width: 600px}
</style>

HTML
<table class='var'>
<tr><td colspan='2' style="text-align:center">RE This is one cool forum.</td></tr>
<tr>
<td style="width:100px;text-align:left">Dylan<br />Posts: 10</td>
<td style="text-align:left;vertical-align:top'><p style="text-align:left'>Me to.</p></td>
</tr>
</table>


Ok I could have did more to improve that code but I kept the way you had it and CSS-ized the code. You should try setting table header cells and the absolute (or relative width of those cells). Based on that your table is 600px wide, I'd recommend:

HTML
<table class='var'>
<tbody>
<tr><th style="width:100px">Posted by...</th><th style="width:500px">Message</th></tr>
<tr><td colspan='2' style="text-align:center">RE This is one cool forum.</td></tr>
<tr>
<td style="text-align:left">Dylan<br />Posts: 10</td>
<td style="text-align:left;vertical-align:top'><p style="text-align:left'>Me to.</p></td>
</tr>
</tbody>
</table>


Also, the <th> contents will automatically be bolded and centered. If you set the absolute width of those cells, the rest of the columns have that width. But you only have 2 columns, the 'RE' one is a spanned cell, so I don't know exactly what you mean by the next cell having an offset because there is no cell beside it. But try my suggestions and see if it works.
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts 5 ssp2010 32 Yesterday, 08:00 PM
Last post by: 8ennett
No new   27 firefoxsilver9 31,629 5th March 2010 - 03:36 AM
Last post by: iG-Vivek Lohia
No New Posts   12 Zeeshan Hashmi 5,195 15th February 2010 - 09:59 PM
Last post by: iG-thewind
No New Posts   3 FirefoxRocks 274 14th February 2010 - 03:52 AM
Last post by: mastercomputers
No New Posts   6 Eggie 1,532 10th February 2010 - 01:29 AM
Last post by: iG-james
No New Posts   12 Nqon 4,598 9th February 2010 - 02:46 PM
Last post by: iG-
No New Posts  
5 PHP
9 vujsa 3,063 12th January 2010 - 08:55 PM
Last post by: iG-
No New Posts   8 starscream 383 4th January 2010 - 11:08 AM
Last post by: starscream
No New Posts   10 Ploforia 1,933 19th December 2009 - 11:13 AM
Last post by: iG-Jeremy John
No new 28 HTML_Guru 5,078 8th December 2009 - 10:43 PM
Last post by: HannahI
No New Posts   3 suicide 4,322 27th November 2009 - 04:05 AM
Last post by: iG-satish
No New Posts   17 proxies 2,750 4th November 2009 - 11:29 PM
Last post by: HannahI
No New Posts 12 Propeng 3,503 3rd November 2009 - 09:55 PM
Last post by: HannahI
No New Posts   11 nightfox 2,255 23rd October 2009 - 07:52 AM
Last post by: surfermac
No New Posts   0 fermin25 139 22nd October 2009 - 07:00 PM
Last post by: fermin25


Web Hosting Powered by ComputingHost.com.
HONESTY ROCKS! truth rules.
Creative Commons License