View: 3095|Reply: 15
|
Masalah nak "center" main table aku kat dreamweaver
[Copy link]
|
|
1. Aku ada masalah nak center kan 'main' table (the table that contains all those banner and pictures)..masalahnyer..kat dalam dreamweaver mmg display center tapi bila kat web browser dia tak tunjuk center but left... pls help
2. macam mana nak buat top dn bottom dia bersambung dengan web browser? korang tak faham maksud aku? ok..cuba lihat lelaman www.espguitars.com .. cuba lihat table sebelah atas dia...ia bersambung dengan web browser...so kirakan straight up ... tapi tidak di sebelah bawah web itu...
dan ini adalah contoh table diorang atas dan di sebelah bawah web bersambung -- http://www.gbase.com/
<html>
<title>Welcome to Eden Online Shop ...</title>
<style type="text/css">
<!--
body {
background-image: url(background.gif);
}
-->
</style><body>
<tr>
<td height="100%" colspan="2" align="center" valign="top"><table width="790" border="1" bordercolor="#000000">
<tr bordercolor="#000000">
<td height="43" colspan="2" align="center" valign="top"><img src="banner_eden.JPG" width="800" height="160" /></td>
</tr>
<tr>
<td width="607" rowspan="3" align="left" valign="top" bordercolor="#000000"> </td>
<td width="187" height="137" align="left" valign="top"></a><img src="vintage.gif" width="187" height="142" /></td>
</tr>
<tr>
<td width="187" height="124" align="left" valign="top"><img src="guitar_ecard.gif" width="187" height="142" /></td>
</tr>
<tr>
<td width="187" height="124" align="left" valign="top"><img src="dealer.gif" width="187" height="142" /></td>
</tr>
<tr bordercolor="#000000">
<td colspan="2" align="center" valign="top"><table width="482" height="200" border="0">
<td width="156" height="148"><img src="dadbutton2.jpg" width="156" height="130" /></td>
<td width="156"><img src="dr-880_156x120.gif" width="156" height="130" /></td>
<td width="156"><img src="wl156x120video.gif" width="156" height="130" /></td>
</tr>
<tr>
<td height="50" colspan="3" align="left" valign="top"><p align="center"><br />
<img src="mgr_animated_468x60_we_buy_drums.gif" width="468" height="60" /> </p>
<p align="center"> </p> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
[ Last edited by sLapshock at 14-7-2006 01:30 AM ] |
|
|
|
|
|
|
|
mana opening tag untuk table? kenapa terus <tr> sedangkan <table> tak define lagi? |
|
|
|
|
|
|
|
salah satu cara guna nested table, tp cara ni rather unorthodox, sekarang ni pakai CSS lagi sesuai... anyway u can try to look at this sample code:
- <html>
- <body>
- <table width="100%" height="100%">
- <tr>
- <td align="center" valign="middle">
- <!-- nested table -->
- <table width="400" height="300" border="1">
- <tr>
- <td>This is a sample table centered within a bigger table</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
Copy the Code
one of the good sites to implement centered content (via CSS) is http://www.driftsafe.org , perhatikan susunan content dalam html page dan CSS stylesheetnya. very clean coding. |
|
|
|
|
|
|
|
kat code yg i paste kat atas tu ada salah tak? macma ada error table ker apa ker
anw masa aku letak <table> kat atas sekali to define...dreamweaver kata ...overlapping tag..it safe to remove..aku remove ok pulak.
[ Last edited by sLapshock at 14-7-2006 09:50 AM ] |
|
|
|
|
|
|
|
overlapping tags jadi sebab i perasan u guna XML format untuk close tags, like so:
<td .... />
yang atas tu sama macam ni:
<td ... ></td>
so, kalau macam ni, salah:
<td ... /></td>
notice the slash at the end of the opening tag? itu biasanya digunakan untuk conform to XML standards for tags without closing tags (macam <br> dan sebagainya), so elok remove. |
|
|
|
|
|
|
|
ok i will remove it. anyway macam mana nak sambungkan tableto the top of th page .. contoh macam
www.gbase.com ... notice kat atas dia tak ruang... the iamge sambng to the very top of the page |
|
|
|
|
|
|
|
paling simple, set margin properties kat body tag
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
atau:
<body style="margin: 0;"> |
|
|
|
|
|
|
|
ok dah boleh..cuma nak tanya..camna nak remove top border tapi...border border di kiri kanan masih kekal..
[ Last edited by sLapshock at 14-7-2006 12:15 PM ] |
|
|
|
|
|
|
|
tukar body style macam ni:
<body style="margin: 0px 20px 0px 20px;"> |
|
|
|
|
|
|
|
ok nanti aku try..com laptop habis pula untuk test.... anw terima kasih banyak2 lah sangat |
|
|
|
|
|
|
|
no problem....
kalau nak mintak tolong buat website pun boleh :cak: :cak: :cak:
anyway selamat mencuba... |
|
|
|
|
|
|
|
tak menjadi la bro...hmm..masih ada border kat sebelah atas dia dan bawah of the table |
|
|
|
|
|
|
|
patutnya dalam dreamweaver ada code completion... senang sikit... saya kat sini takde so takbleh check...
try ni pulak:
- <body style="margin-top: 0; margin-bottom:0;">
Copy the Code
it's better to use stylesheets than embedded styles |
|
|
|
|
|
|
|
ok thanks..i tried later..anw bengang ni...aku buat table..then when i wanted t move the nested table...dgn table table besar bergerak...dah jadi rojak table ku |
|
|
|
|
|
|
|
best way is to get used to stylesheets, guna <div> tags, sekarang standard macam tu... you may find that it's much more manageable and more professional. |
|
|
|
|
|
|
| |
|