bookmark - Some Odd Things With Html Tables

Some Odd Things With Html Tables

 
 Discussion by sparkx with 1 Replies.
 Last Update: June 22, 2007, 6:40 pm
 
bookmark - Some Odd Things With Html Tables  
    
free web hosting
 
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

Fri Jun 22, 2007    Reply    New Discussion   


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:

CODE

<style type="text/css">
.var{width: 600px}
</style>

CODE

<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:

CODE

<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.

Fri Jun 22, 2007    Reply    New Discussion   

Quickly Post to Some Odd Things With Html Tables  w/o signup Share Info about Some Odd Things With Html Tables  using Facebook, Twitter etc. email your friend about Some Odd Things With Html Tables Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

Need Help With Correct Programming   Need Help With Correct Programming (2) (4) Need Help Please Xd   Need Help Please Xd