Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html TwitterBootstrap rails最大列宽_Html_Css_Ruby On Rails 3_Column Width_Twitter Bootstrap Rails - Fatal编程技术网

Html TwitterBootstrap rails最大列宽

Html TwitterBootstrap rails最大列宽,html,css,ruby-on-rails-3,column-width,twitter-bootstrap-rails,Html,Css,Ruby On Rails 3,Column Width,Twitter Bootstrap Rails,我正在开发一个非常简单的应用程序,它是使用twitter引导程序rails设计的。我的模型索引页面上有一个表,显示数据,看起来非常棒。问题是,如果有人在其中一个字段中输入一个很长的未中断文本字符串(例如URL),则该列的宽度将与其他所有列一起拉伸和挤压。我想用一些方法来加强列的宽度,并告诉浏览器将非常长的单词分开 到目前为止,我尝试的是为每个添加一个类,并尝试使用CSS控制宽度。这里有一个例子 <table> <thead> <tr>

我正在开发一个非常简单的应用程序,它是使用twitter引导程序rails设计的。我的模型索引页面上有一个表,显示数据,看起来非常棒。问题是,如果有人在其中一个字段中输入一个很长的未中断文本字符串(例如URL),则该列的宽度将与其他所有列一起拉伸和挤压。我想用一些方法来加强列的宽度,并告诉浏览器将非常长的单词分开

到目前为止,我尝试的是为每个
添加一个类,并尝试使用CSS控制宽度。这里有一个例子

<table>
  <thead>
    <tr>
      <th class="column1"> etc
      <th class="column2"> etc
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="column1"> etc
      <td class="column2" etc
    </tr>
  </tbody>
</table>

到目前为止,这对我不起作用,我想知道我是否需要如此频繁地复制我的代码

最后我自己修好了。我所做的是使用最大宽度而不是宽度

th.column1 td.column1 { max-width:300px; word-wrap:break-word; }

,Twitter引导rails与引导本身有什么不同吗。
th.column1 td.column1 { max-width:300px; word-wrap:break-word; }