2012-06-19 62 views
2

能有人幫我,這是推動我瘋了。我在這個網站上看到了其他問題的答案,但我似乎不能應用它們。固定寬度

基本上我試圖解決我的表的寬度在HTML Dreamweaver中。但它似乎並沒有工作。

我當前的代碼如下所示:

table align="center" style='table-layout:fixed' width="910" height="627" border="0" 

,但它仍然擴大了指定的寬度以上。

我曾嘗試也做到這一點的:

.fixed { table-layout: fixed; } 

<td width="18" class="fixed"></td> 

但是,這並不工作要麼!

回答

0

可能是你可以嘗試這樣的事情。

<div style="overflow:hidden;width:910px"> 
<table> 
<tr> 
    <td>...</td> 
</tr> 
</table> 
</div> 

或者你可以給溢出:滾動如果你需要一個滾動條。

1

你可以嘗試把你的類所需要的所有樣式,

.fixed { table-layout: fixed; width: 910px; height: 627px; border: none; text-align: center;} 

然後只需將類表:

<table class="fixed"> 

此外,你可以澄清你的意思是什麼「試圖修復寬度「在你的桌子上?你可以在桌子周圍張貼更多的代碼,或者整張桌子本身嗎?

0

要做的第一件事:擺脫像align,widthborder這樣的HTML4屬性,並單獨使用CSS做到這一點。將絕對寬度設置爲表格應該沒有問題。

其次,你不需要設置固定寬度的表。 <table style="width: 910px;">應該就夠了。

0

感謝您的答覆.....我很新的這一點,但我會盡量擴大

基本上,下面是我的樣式表和代碼的開始。我想,主體和頂部到表格的最大寬度爲910.我在這些內部創建了其他表格,並且當信息輸入到單元格中時,它不會環繞,它只是使頁面成爲更大的寬度... ..我不希望這是可能的

<style type="text/css"> 
body { background-color: #000;font-family: Comic Sans MS, cursive;font-size: 12px;color: #000;text-align:left 
    width="910" height="627" border="0" } 

.mainbody {background-color: #fff;width="844px" table-layout: fixed;} 
.background {background-color: #000;} 

.banner_f { color: #FFFFFF;font-weight: bold;font-size: 36px;font-family: Verdana, Arial, Helvetica, sans-serif; 
     width="910" height="203" table-layout: fixed;} 

</style> 

「/Images/Buttons/Fixtures_Top.jpg','/Images/Buttons/Scorers_Top.jpg','/Images/Buttons/ Reports_Top.jpg」, '/圖像/按鈕/ Contact_Top.jpg') 「> 寬度=」 844" HEIGHT = 「68」> `