html - 如何使用 auto bootstrap4 内联列
问题描述
我想用响应的列表内联列图标。我的问题是第二列自动换行。而我已经使用了一个响应式表格,如果从宽度父级出来,它将滚动 x。但是,第二列自动换行。我不想要那个。我发表评论以进行快速调查。
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<!-- Variabel col depedent content -->
<div class="col-auto">
<span>Iconaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span>
</div>
<!-- Auto fill left col -->
<div class="col">
<div class="table-responsive">
<table class="table table-sm table-bordered table-striped table-primary">
<thead>
<tr>
<th width="1%">No</th>
<th width="7%">Pengirim</th>
<th>Pesan</th>
<th>Tanggal</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>0123456789012</td>
<td>1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111</td>
<td>@mdo</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
解决方案
请使用分词:break-word;
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<div class="container-fluid">
<div class="row flex-nowrap">
<!-- Variabel col depedent content -->
<div class="col-auto">
<span>Iconaaaaaaaaaaaa</span>
</div>
<!-- Auto fill left col -->
<div class="col" style="min-width:0;word-break: break-word;">
<div class="table-responsive">
<table class="table table-sm table-bordered table-striped table-primary">
<thead>
<tr>
<th width="1%">No</th>
<th width="7%">Pengirim</th>
<th>Pesan</th>
<th>Tanggal</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>0123456789012</td>
<td>1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111</td>
<td>@mdo</td>
</tr>
<tr>
<th>2</th>
<td>9876543210321</td>
<td>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</td>
<td>@mdo</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
推荐阅读
- regex - 如何使用字符向量长度大于 1 的 grepl?
- c# - ASP.NET Core CORS 配置不适用于 Firefox
- swift - 如何在 Flutter 中实现 3D Secure(通过 Visa / MasterCard SecureCode 验证)?
- c# - 我如何为类型列表应用运算符“/”和“-”
和双? - xcode - 在 Swift 中沿用鼠标绘制的线运行 SKSpriteNode 对象
- c++ - 虚拟析构函数将对象移出rodata部分
- asp.net-core - 如何仅使用 Blazor 获取 API 响应状态代码?
- c++ - 子进程在 fork 和 exec 后变为 Defunct
- typescript - TS:类私有属性未定义,但私有静态未定义。为什么?
- typescript - 如何确保类型在数组中?