2013-01-31 67 views
0

我想用Twitter Bootstrap使用.haml創建兩個表。問題是,我的第二張桌子很好地呈現,但我的第一張桌子,其文本少得多,似乎在整個頁面上無限延伸。我怎麼能設置我的第一個表格列寬度是小的,在不同的寬度比第二個表格?我試過了:class =>「table table-condensed」,但仍然太大。Twitter Bootstrap表列 - 第一個表比第二個表更短的列寬

%html 
    %head 
    %link(rel="stylesheet" href="css/bootstrap.css") 
    %link(rel="stylesheet" href="css/my.css") 
    %title Working Units 
    %body 
    %p 
    %p These are the units that are updating. 
%table{:class => "table table-bordered"} 
    %thead 
    %tr 
     %th Job 
     %th Age 
    %tbody 
    - @plines.each do |row| 
     %tr 
     - row.split(/[-,]/).each do |column| 
      %td= column 
%p These are the units that are not updating. 
%table{:class => "table table-bordered"} 
    %thead 
    %tr 
     %th Job 
     %th Age 
     %th Time 
    %tbody 
    - @mlines.each do |row| 
     %tr 
     - row.split(/[-,]/).each do |column| 
      %td= column 
%a{:href=>"/"} Back to the form 

回答

0

裹表的div與特定寬度:

:css 
    .halfsize { 
      width: 50%; 
    } 
.halfsize 
    %table{:class => "table table-bordered"} 
     %thead 
     %tr 
      %th Job 
      %th Age 
     %tbody 
     - @plines.each do |row| 
      %tr 
      - row.split(/[-,]/).each do |column| 
       %td= column 
+0

謝謝;這很有幫助。 – jumar

相關問題