Looking to customize the layout of a nav-tabs ul to display its contents in 2 columns instead of horizontally, as per the default Bootstrap style for nav-tabs.
Attempted to use the CSS property column-count: 2
but it didn't yield the desired result.
Shown below is the code snippet:
<ul class="nav nav-tabs ml-0 mr-0 bg-primary two-columns" role="tablist" style="column-count: 2;">
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#cont1" role="tab">Title 1</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont2" role="tab">Title 2</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont3" role="tab">Title 3</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont4" role="tab">Title 4</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont5" role="tab">Title 5</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont6" role="tab">Title 6</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont7" role="tab">Title 7</a></li>
<li class="nav-item"><a class="nav-link " data-toggle="tab" href="#cont8" role="tab">Title 8</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content ml-2 mr-2">
<div class="tab-pane jumbotron active" id="cont1" role="tabpanel">Content 1</div>
<div class="tab-pane jumbotron active" id="cont2" role="tabpanel">Content 2</div>
<div class="tab-pane jumbotron active" id="cont3" role="tabpanel">Content 3</div>
<div class="tab-pane jumbotron active" id="cont4" role="tabpanel">Content 4</div>
<div class="tab-pane jumbotron active" id="cont5" role="tabpanel">Content 5</div>
<div class="tab-pane jumbotron active" id="cont6" role="tabpanel">Content 6</div>
<div class="tab-pane jumbotron active" id="cont7" role="tabpanel">Content 7</div>
<div class="tab-pane jumbotron active" id="cont8" role="tabpanel">Content 8</div>
</div>
Additionally, I've defined a custom CSS class two-columns
ul.two-columns {
-moz-column-count: 2 !important;
-moz-column-gap: 2.5em !important;
-webkit-column-count: 2 !important;
-webkit-column-gap: 2.5em !important;
column-count: 2 !important;
column-gap: 2.5em !important;
}
It seems that the JavaScript included in Bootstrap could be interfering with my custom styles. Any suggestions on how to resolve this issue?