Houve
Houve

Reputation: 482

Setting a maximum width at collapsed columns

I got a table with collapsing rows exactly like this: Collapsing table

As you see in the example, if the row is expanding the first column is growing unnecessary wider. (It's already too big anyway)

Neither setting a maximum width in percent or in pixel, nor defining the column as "col-2"(bootstrap4) works.

How can i set the width of the first column?

Upvotes: 1

Views: 35

Answers (1)

Florient
Florient

Reputation: 236

You can try setting your fixed width on the th tag of your column :

<table class="table table-responsive table-hover">
   <thead>
        <tr>
            <th style="width: 25px">Column</th>
            <th>Column</th>
            <th>Column</th>
            <th>Column</th>
        </tr>
    </thead>
    <tbody>
      ...
    </tbody>
</table>

Your forked bootply : https://www.bootply.com/ITB1qlMHDW

Upvotes: 1

Related Questions