HTML Question?

2008-07-16 10:36 pm
I have three tables that (widths of 15%, 70%, 15%) I want for them to be side by side. But when coded, they are all stacked on each other. How do I fix this?
更新1:

CODE: <table id="nav" width="15%"> <tr><td class="all"><h4> TEST </h4></td></tr> </table> <!-- NAV TABLE --> <table id="content" width="70%"> <tr><td class="all"><h4> TEST </h4></td></tr> </table> <!-- NAV TABLE --> <table id="other" width="15%"> <tr><td class="all"><h4> TEST </h4></td></tr> </table>

回答 (7)

2008-07-17 12:11 am
✔ 最佳答案
I agree with Philip
2008-07-16 10:58 pm
Web designers do not use tables for layout work. We all use CSS. It kinda looks like that is exactly what you are trying to do.

The easy answer: create a 3 column table and stack the other tables inside of it.

The correct answer: Use CSS to build left, center and right divisions.

This will get you started:
http://www.w3schools.com/css/default.asp

Good luck
2008-07-16 11:10 pm
Don't listen to the last guy. You do what is easiest for you. There is a million ways to do one thing. but here's a simple solution based on what you already know. Put the tables inside another table with the cells side by side like this:

<table>
<tr><td>
table 1
</td><td>
table 2
</td><td>
table 3
</td></tr>
</table>

There is no such thing as real website builders
either you do, or you don't. That simple.

Do note though that CSS can give you more options when it comes to positioning.
參考: I build websites too.
2008-07-17 3:00 am
You have to position them on the page. They are all being positioned at (0,0).
2008-07-17 1:20 am
Your code shows that you're making three separate tables.

If you want them to be side-by-side, the easiest way is to do this:

<table>
<tr>
<td width="15%" valign="top">Test 1</td>
<td width="75%" valign="top">Test 2</td>
<td width="15%" valign="top">Test 3</td>
</tr>
</table>

Replace "Test 1" with the content you want to have in that cell, etc.
2008-07-16 10:43 pm
Try using CSS to make the first table have 0 padding, second table have 15% padding, and the third to have 85% padding.
2008-07-16 10:42 pm
show me the code
-----------------------
try adding
float:left;
in each id in the css file
example
#nav{
float:left;
}
#content{
float:left;
}
#other{
float:left;
}

if it does'nt work make sure position and clear properties having default values.


收錄日期: 2021-05-03 11:50:15
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080716143615AAccdnd

檢視 Wayback Machine 備份