Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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 防止元件膨胀_Html_Css_Html Table - Fatal编程技术网

Html 防止元件膨胀

Html 防止元件膨胀,html,css,html-table,Html,Css,Html Table,我有一个表,其中有一列URL,有时URL会变得很长 我将表格设置为具有特定的宽度,但有时URL甚至不会自行中断并扩展表格,这会使布局混乱 这里有一个代码供您查看,我将提供以下代码: HTML 您可以使用表格布局:fixed和换行:break-word 表格{ 表布局:固定; 宽度:500px; 保证金:5px; } 运输署{ 单词包装:打断单词; } 名称 统一资源定位地址 试验 http://www.exampledomain.org/How-We-Work/General-Infor

我有一个表,其中有一列URL,有时URL会变得很长

我将表格设置为具有特定的宽度,但有时URL甚至不会自行中断并扩展表格,这会使布局混乱

这里有一个代码供您查看,我将提供以下代码:

HTML


您可以使用
表格布局:fixed
换行:break-word

表格{
表布局:固定;
宽度:500px;
保证金:5px;
}
运输署{
单词包装:打断单词;
}

名称
统一资源定位地址
试验
http://www.exampledomain.org/How-We-Work/General-Information/General-Opportunities/Open-Concept-Memo-Global-Test-Cases
名称
统一资源定位地址
另一个测试
http://www.exampledomain.org/search?q=flagship+协作+研究+计划&btnG=Google%2BSearch&client=csiro_frontend&output=xml_no_dtd&proxystylesheet=csiro_frontend&proxyreload=0&sort=date%253AD%253AL%253Ad1&wc=200&wc_mc=1&oe=UTF-8&ud=1&exclude__应用程序=1&site=Main&filter=0&getfields=*&sourcepage={CB41B120-BEE43681;-4511-9BED}

您可以使用
表格布局:固定
换行:断开单词

表格{
表布局:固定;
宽度:500px;
保证金:5px;
}
运输署{
单词包装:打断单词;
}

名称
统一资源定位地址
试验
http://www.exampledomain.org/How-We-Work/General-Information/General-Opportunities/Open-Concept-Memo-Global-Test-Cases
名称
统一资源定位地址
另一个测试
http://www.exampledomain.org/search?q=flagship+协作+研究+计划&btnG=Google%2BSearch&client=csiro_frontend&output=xml_no_dtd&proxystylesheet=csiro_frontend&proxyreload=0&sort=date%253AD%253AL%253Ad1&wc=200&wc_mc=1&oe=UTF-8&ud=1&exclude__应用程序=1&site=Main&filter=0&getfields=*&sourcepage={CB41B120-BEE43681;-4511-9BED}

你能用它来缩短URL吗?@mlegg抱歉,但不能。你能用它来缩短URL吗?@mlegg抱歉,但不能。我投票支持这一点,因为这是可行的,但我必须做一些事情,比如不让第一列获得基于百分比的宽度。我更喜欢阿尔金的答案,因为这是一个非常简单的解决方案。不过,谢谢!我投票支持这一点,因为它是可行的,但我必须做一些事情,比如不让第一列获得基于百分比的宽度。我更喜欢阿尔金的答案,因为这是一个非常简单的解决方案。不过,谢谢!
<table border="1">
  <thead>
    <tr>
      <th>Name</th>
      <th>URL</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Test</td>
      <td>http://www.exampledomain.org/How-We-Work/General-Information/General-Opportunities/Open-Concept-Memo-Global-Test-Cases</td>
    </tr>
  </tbody>
</table>

<table border="1">
  <thead>
    <tr>
      <th>Name</th>
      <th>URL</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Another Test</td>
      <td>http://www.exampledomain.org/search?q=flagship+collaborative+research+program&btnG=Google%2BSearch&client=csiro_frontend&output=xml_no_dtd&proxystylesheet=csiro_frontend&proxyreload=0&sort=date%253AD%253AL%253Ad1&wc=200&wc_mc=1&oe=UTF-8&ie=UTF-8&ud=1&exclude_apps=1&site=Main&filter=0&getfields=*&sourcepage={CB41B120-BEE8-4511-9BED-A5E43D32381D}</td>
    </tr>
  </tbody>
</table>
table {
  width: 500px;
  margin: 5px;
}
td {
   word-break: break-word;
}