Table column width #890
-
Table column width inside tabProblemI have a tabular menu and in each tab a table. I have set the class for width as described in docs inside the <div class="ui secondary pointing menu">
<a class="item active" data-tab="tab1">Tab1</a>
<a class="item mobile hidden" data-tab="tab2">Tab2</a>
<a class="item mobile hidden" data-tab="tab3">Tab3</a>
<div class="ui tab segment active" data-tab="tab1">
<table class="ui table" id="table1">
<thead>
<tr>
<th class="one wide center aligned">Title1</th>
<th class="two wide center aligned">Title2</th>
<th class="two wide center aligned">Title3</th>
<th class="two wide center aligned">Title4</th>
<th class="nine wide">Title5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="center aligned"><i class="green check circle outline icon"></i></td>
<td class="center aligned selectable">
<a href="{% url 'projekti' %}">52-01</a>
</td>
<td class="center aligned">R00</td>
<td class="center aligned">01.08.2019.</td>
<td>Test</td>
</tr>
</tbody>
</table>
</div>
<div class="ui tab segment mobile hidden" data-tab="Tab2">
<table class="ui table" id="table2">
<thead>
<tr>
<th class="one wide center aligned">Title1</th>
<th class="two wide center aligned">Title2</th>
<th class="two wide center aligned">Title3</th>
<th class="two wide center aligned">Title4</th>
<th class="nine wide">Title5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="center aligned"><i class="green check circle outline icon"></i></td>
<td class="center aligned selectable">
<a href="{% url 'projekti' %}">52-01</a>
</td>
<td class="center aligned">R00</td>
<td class="center aligned">01.08.2019.</td>
<td>Test</td>
</tr>
</tbody>
</table>
</div> $('.menu .item')
.tab(); On page load whatever tab i set to active (with the class What I'm doing wrong? EditNow i see that Datatables are messing with the table rendering: |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
I am not sure if i understood your question/issue correctly but making use of your fiddle you can adjust the column widths, so left row for example becomes |
Beta Was this translation helpful? Give feedback.
-
@lubber-de in his JSfiddle the column width in none-active Tabs is equal instead of based on the width class given |
Beta Was this translation helpful? Give feedback.
-
Ah ❗️ , now i see 😄 |
Beta Was this translation helpful? Give feedback.
-
I don have problems with the left menu. They overlay only in JSFiddle. The problem is inside tabs and with the table. Im talking with ColinFrick on Discord and this is his reply:
Does anyone know if i can do anything to get this working? |
Beta Was this translation helpful? Give feedback.
-
Initiate DataTables with the option autoWidth: false, |
Beta Was this translation helpful? Give feedback.
-
btw there is a bug in datatables when calculating: It basically calculates correct percentage values width but adds "px" (so "12.5px" instead of "12.5%", thus it's broken) |
Beta Was this translation helpful? Give feedback.
-
This solution worked for me. |
Beta Was this translation helpful? Give feedback.
-
There is a PR for datatables to fix column width calculation correctly |
Beta Was this translation helpful? Give feedback.
Initiate DataTables with the option
See https://jsfiddle.net/c0uykeq1/