Some Odd Things With Html Tables

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > Misc. Programming Languages

Some Odd Things With Html Tables

sparkx
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

 

 

 


Reply

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

 

 

 


Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : odd things html tables

  1. HTM vs HTML: Whats The Difference ? - (22)
    hi friends, Does anybody know the difference between .htm and .html files. I am wondering why there
    are two extensions for the same type of files!! Even some hosts make the index.htm as the
    home page and some do the other way. Isn't there any standard for making the home page. Some
    even use default.htm as home page. When the page with different extension is present then it gives a
    404 (Page Not Found) Error. Any light in that direction will be of much help. Regards....
  2. Video Player - with html (0)
  3. Why Does HTML File Saved Show As IE File? - (4)
    I saved a little project I was doing that I wanted to use for my new webpage. Well, I saved it in
    regular old notepad and it is strictly in HTML. The space where it says 'type of file' I
    put 'all files' because there is no option for HTML. For file name I put FTVmain.html. But
    for some reason, when I go to notepad to open the file, it shows it as a Internet Explorer file. I
    don't remember an HTML file being shown as an IE file before. Is that what it is supposed to be
    or am I doing something wrong?...



Looking for odd, things, html, tables

Searching Video's for odd, things, html, tables
advertisement




Some Odd Things With Html Tables



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE