Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap, how can I make two tables the same "width"

I got two tables as this:

tables

I want them to have the same width, I don't know what it's called but you can see that the columns dosn't have the same width.

Here is my code for it:

    <aside>
    <table class="table table-bordered" style="margin: 0;">
        <thead>
        <tr></tr>
        <tr></tr>
        </thead>
        <tbody>
        <tr>
            <td class="tableHeader">Pilot ID</td>
            <td><?php echo 'SAS ' . $results['id'];?></td>
        </tr>
        <tr>
            <td class="tableHeader">First Name</td>
            <td><?php echo $results['firstname'];?></td>
        </tr>
        <tr>
            <td class="tableHeader">Last Name</td>
            <td><?php echo $results['lastname'];?></td>
        </tr>
        <tr>
            <td class="tableHeader">Age</td>
            <td>17</td>
        </tr>
        <tr>
            <td class="tableHeader">Distance Flown</td>
            <td>3790 km</td>
        </tr>
        <tr>
            <td class="tableHeader">Flights</td>
            <td><?php echo $results['flights'];?></td>
        </tr>
        <tr>
            <td class="tableHeader">Flight Hours</td>
            <td><?php echo $results['flighttime'];?></td>
        </tr>
        </tbody>
    </table>
    <table class="table table-bordered style="margin: 0;"">
    <thead>
    <tr></tr>
    <tr></tr>
    </thead>
    <tbody>
    <tr>
        <td class="tableHeader">737-600</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">737-700</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">737-800</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">A319</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">A320</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">A321</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">A330</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">A340</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">CRJ-900</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">ATR-600</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">717</td>
        <td></td>
    </tr>
    <tr>
        <td class="tableHeader">SAB 2000</td>
        <td></td>
    </tr>
    </tbody>
    </table>
</aside>

JSFIDDLE: https://jsfiddle.net/ncqmy09c/

like image 425
Gustav P Svensson Avatar asked Mar 27 '26 19:03

Gustav P Svensson


1 Answers

You could do.

.table {
    table-layout: fixed;
}

http://jsfiddle.net/vawtr0u5/

like image 143
Stickers Avatar answered Mar 29 '26 11:03

Stickers