views:

345

answers:

3

Anybody any ideas how to achieve this I want this effect

<table>
  <tr><td width=100></td><td width=100></td></tr>
</table>

I can do it with float, or position absolute, but can it be done without these two?

A: 

Tables should only be used for tabular information, you should avoid using tables for creating layouts, instead you should use DIV-based layouts. See my answer here for more details about this. Since you have asked for a solution without floats, position (which means divs), the only other option we are left with is tables, so here is how you might go on to creating table based two column layout.

 <table width="60%" border="1" align="center">
 <tr>
  <td width="50%" align="left">
    <table>
      <tr>
        <td>Colume One</td>
      </tr>
    </table>    
  </td>

  <td width="50%" align="left">
    <table>
      <tr>
        <td>Colume Two</td>
      </tr>
    </table>    
  </td>

 </tr>
</table>

Again, using tables for layouts is not a good idea :)

Sarfraz
Tables are designed for tabular data - nothing more.
Crozin
@Crozin: so quick man: read the title of the question again: I can do it with float, or position absolute, but can it be done without these two? He needs div-less solution which means tables. Think Again Please !!!!!!!!!!
Sarfraz
@Crozin: and i know what tables are supposed to do, see my score for this question: http://stackoverflow.com/questions/2235029/should-i-use-table-or-ul/2235044#2235044. I have already answered this, so i know what it is all about, the quetioner needed table-based solution. Thanks again !!!!!!
Sarfraz
Either my sarcasm detector is in dire need of complete re-calibration or this is the single most... ehm... *bewildering* answer I have seen all day.
RegDwight
If he need table-like behaviour he's supposed to use CSS `display` property (yeah, I know IE6 doesn't support it well). Using tables for layout design is wrong - **it's evil** - especially nested tables. btw: `width`, `border`, `align` - that should be moved to CSS.
Crozin
@Crozin: and i know what tables are supposed to do, see my score for this question: http://stackoverflow.com/questions/2235029/should-i-use-table-or-ul/2235044#2235044. I have already answered this, so i know what it is all about, the quetioner needed table-based solution.
Sarfraz
@Crozin: please go to this link and see my answer: http://stackoverflow.com/questions/2235029/should-i-use-table-or-ul/2235044#2235044
Sarfraz
@Crozin, @RegDwight: I have updated my answer because of the fact that you could not understand what i wanted to say through these comments, so please have a look at my updated answer above. Thanks a lot .......
Sarfraz
A: 

make use of a list displayed inline, fix margin and padding and it should work well. This will allow you to have more that two columns if you want to expand later.

<ul>
<li>First column</li>
<li>Second Column</li>
</ul>

CSS

li
{
display:inline;
}

Don't forget to put enough margin/padding to make it look better.

Omar Abid
A: 

solution found with css3

Grumpy
Would you care to post the solution..? Telling us you found it won't help people that come across this problem later.
musicfreak
Only css3 let you do this
Grumpy