2016-12-01 7 views
0

私は写真の下の名前の行にあるセル間のスペースを減らそうとしています。私は運がなければ見つけることができるすべてを試しました。誰も私の名前を表の中でもっと近くに座らせる方法を教えてもらえますか?私はフィドルを作ったhere。私はあなたがCSSのリセットスクリプトを必要とするブートストラップ3。多くのおかげでテーブルセル間のスペースを減らす方法は?

Htmlの

<div class="container"> 

    <div class="col-xs-12 col-md-6 col-sm-8 col-lg-6 center-block animated fadeInUp"> 

    <div class="results"> 
     <ul id="results"> 
     <!-- results appear here --> 
     <h3> 
Image title 
</h3> 
     <div class="dark"> 
      <a href="page.php?page_id=241"><img src="http://www.fiji.travel/sites/default/files//styles/views-large-thumbnail/public/arial-of-island.jpg?itok=KZHGX6pJ" width="600" class="img-responsive" alt=""></a> 
     </div> 





     <small>posted by: 

             <a href="profile.php?user_id=user_id" span="" class=""> 
               Anderson</a></small> 

<!-Make These names sit closer together---> 
     <table id="myTable2" border="0" cellpadding="0" cellspacing="0" class="table" style="width:auto;"> 
      <tbody> 

      <tr style="\&quot;display:none;\&quot;"> 
       <td valign="top"><strong><a href="profile.php?user_id=6" class="tags" style="color:"> 
               Anderson,</a>&nbsp;</strong></td> 
       <td valign="top"><strong><a href="profile.php?user_id=9" class="tags" style="color:#3cb0fd"> 
               James Bond,</a>&nbsp;</strong></td> 
       <td valign="top"><strong><a href="profile.php?user_id=2" class="tags" style="color:"> 
               Julian,</a>&nbsp;</strong></td> 
      </tr> 
      </tbody> 
     </table> 
     <hr> 

答えて

0

を使用しています。新しいサイトを構築するときはいつでも、これを一番上のCSSスクリプトにします。すべての要素でパディングと余白をゼロに設定します。表のセルでは、デフォルトのパディングは通常2ピクセルです。

他にもありますが、これは悪いスタートではありません。

#myTable2 td { 
    padding: 0 0; 
} 

それはあなたが取り除くしたいパディングを削除し、セルが右隣同士になります。http://meyerweb.com/eric/tools/css/reset/

/* http://meyerweb.com/eric/tools/css/reset/ 
    v2.0 | 20110126 
    License: none (public domain) 
*/ 

html, body, div, span, applet, object, iframe, 
h1, h2, h3, h4, h5, h6, p, blockquote, pre, 
a, abbr, acronym, address, big, cite, code, 
del, dfn, em, img, ins, kbd, q, s, samp, 
small, strike, strong, sub, sup, tt, var, 
b, u, i, center, 
dl, dt, dd, ol, ul, li, 
fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td, 
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary, 
time, mark, audio, video { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    font-size: 100%; 
    font: inherit; 
    vertical-align: baseline; 
} 
/* HTML5 display-role reset for older browsers */ 
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section { 
    display: block; 
} 
body { 
    line-height: 1; 
} 
ol, ul { 
    list-style: none; 
} 
blockquote, q { 
    quotes: none; 
} 
blockquote:before, blockquote:after, 
q:before, q:after { 
    content: ''; 
    content: none; 
} 
table { 
    border-collapse: collapse; 
    border-spacing: 0; 
} 
2

からあなたのCSSにこれを追加します。

+0

これは私が作ったが、私のページにはない(whochはブートストラップテンプレートを使用しています)。 – JulianJ

関連する問題