2013-03-22 70 views
0

我不確定需要多少信息來幫助我,所以讓我知道是否需要提供更多信息。jQuery DataTables - 我無法獲得想要的效果我想要

我使用jQuery DataTables與Themeroller。我試圖做到這一點看看:

enter image description here

但是,不管我怎麼努力,這就是我得到:

enter image description here

我以紅色突出顯示區域I與...有問題。基本上它是頁眉和頁腳。我知道圖像有點難以看清,但是就好像頁眉和頁腳塊只是部分被繪製。根據Chrome的面積是1600px乘12px。它看起來應該至少50px或更多。

我包括以下.css文件:

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
     <meta charset="utf-8" /> 
     <title> - The Exchange Site</title> 
     <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
     <meta name="viewport" content="width=device-width" /> 
     <link href="/Content/jquery.ui.theme.css" rel="stylesheet"/> 
     <link href="/Content/site.css" rel="stylesheet"/> 
     <link href="/Content/jquery.dataTables.css" rel="stylesheet"/> 
     <link href="/Content/jquery.dataTables_themeroller.css" rel="stylesheet"/> 
     <link href="/Content/PagedList.css" rel="stylesheet"/> 

我在我的HTML底部的JavaScript如下:

<script> 
    $(document).ready(function() { 
     oTable = $('#buyerNotification').dataTable({ 
      "bJQueryUI": true, 
      "sPaginationType": "full_numbers", 
      "bProcessing": true, 
      "iDisplayLength": 25, 
      "aaSorting": [[0, 'desc']] 
     }); 
    }); 

當我在Chrome檢查網頁,沒有任何錯誤正在生成。如果它有助於包括更多,我可以這樣做,就像我的HTML一樣,但是它有很多。

+0

你能顯示你的html嗎?只有一行應該是好的,但看到表結構會很好。所以你的桌子..有一行的tbody – 2013-03-22 20:25:27

+0

我不認爲看到HTML會特別有用;它都是由DataTables API生成的。 Randy,自從我實現了我以來一直都不知道爲什麼,但我記得保留了一些基本的DataTables CSS,即使我也使用jQuery UI。我還添加了一些自己的自定義規則來補充jQuery UI;看起來像你的頁眉和頁腳沒有佈局。選擇一個封裝它們的選擇器並嘗試在它們上面放置「overflow:hidden」。 – 2013-03-22 20:26:58

+0

當我們想在小提琴/ jsbin中測試以查看問題的真實性並查看是否可以複製時,它非常有用 – 2013-03-22 20:34:13

回答

0

參見here。你有沒有指定"bJQueryUI": true選項?

+0

沒關係。你剛剛添加的JavaScript和選項在那裏。 – 2013-03-22 20:03:07