nn3112337
nn3112337

Reputation: 599

Firefox table cell width completly different than Chrome's

I have a problem with my table cell width. On Chrome it works perfectly, but on Firefox it looks a lot different and I don't whats causing it.

This is the chrome one, looking perfect: enter image description here

This is the Firefox one, being squeezed tight: enter image description here

Any idea why this is? Heres my code.

/* Latest games */
.lp-latestgames {
    height: 466px;
}
.lp-latestgames .title {
    margin-left: 460px;
    margin-top: 56px;
    margin-bottom: 21px;
}
.lp-latestgames .table {
    margin-bottom: 0;
}
.lp-latestgames .table thead {
    background-color: rgba(0, 0, 0, 0.45);
}
.lp-latestgames .table thead th {
    font-size: 16px;
    font-weight: 500 !important;
    color: white;
    height: 49px;
    vertical-align: middle;
}
.lp-latestgames .table thead > tr > th { border-bottom: none; }
.lp-latestgames .table tbody > tr > td {
    height: 81px;
    border-top: 2px solid #111316;
    background-color: rgba(0, 0, 0, 0.19);
    vertical-align: middle;
    font-size: 14px;
    font-weight: 500;
    color: white;
}
.lp-latestgames .table tbody > tr:first-child > td { border-top: none; }
.lp-latestgames .table tbody > tr > td:first-child,
.lp-latestgames .table thead > tr > th:first-child{
    /* ÜBERARBEITEN!!!!! */
    padding-left: 460px;
    max-width: 200px;
}
.lp-latestgames .table tbody > tr > td:last-child,
.lp-latestgames .table thead > tr > th:last-child{
    /* ÜBERARBEITEN!!!!! */
    padding-right: 460px;
    max-width: 200px;
}
.lp-latestgames .table tbody > tr > td > .gd-c-versus {
    display: block;
    font-weight: normal;
    font-family: Arial;
    color: #494949;
}
.lp-latestgames .table thead > tr > th:nth-child(4),
.lp-latestgames .table thead > tr > th:nth-child(5),
.lp-latestgames .table tbody > tr > td:nth-child(4),
.lp-latestgames .table tbody > tr > td:nth-child(5) {
    text-align: center;
}
<div class="lp-latestgames">
        <!-- Games -->
        <table class="table">
            <thead>
            <tr>
                <th>Name <img src="img/gd_content_arrow_dn.png"></th>
                <th>Price Pool <img src="img/gd_content_arrow_dn.png"></th>
                <th>Entry <img src="img/gd_content_arrow_dn.png"></th>
                <th>Avg Skill <img src="img/gd_content_arrow_dn.png"></th>
                <th>Time Remaining <img src="img/gd_content_arrow_up.png"></th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>Im bored. Fite me<span class="gd-c-versus">1 vs 1</span></td>
                <td><img src="img/gd_content_coin.png"> 20</td>
                <td><img src="img/gd_content_coin.png"> 10</td>
                <td><input type="text" value="730" class="circle"></td>
                <td>00:00:32</td>
            </tr>
            <tr>
                <td>EG vs LGD - Wild Cards Entry<span class="gd-c-versus">5 vs 5</span></td>
                <td><img src="img/gd_content_coin.png"> 1.500.000</td>
                <td><img src="img/gd_content_coin.png"> 20</td>
                <td><input type="text" value="980" class="circle"></td>
                <td>00:01:47</td>
            </tr>
            <tr>
                <td>cyka blyat<span class="gd-c-versus">5 vs 5</span></td>
                <td><img src="img/gd_content_coin.png"> 20</td>
                <td><img src="img/gd_content_coin.png"> 10</td>
                <td><input type="text" value="730" class="circle"></td>
                <td>00:02:4</td>
            </tr>
            </tbody>
        </table>
    </div>

Upvotes: 2

Views: 2655

Answers (3)

Andr&#233;s
Andr&#233;s

Reputation: 1

Try to set th or td width using rem instead of px Each rem equals 16px

Upvotes: 0

zer00ne
zer00ne

Reputation: 43880

Try adding this:

.table { table-layout: fixed }

See snippet See POST

/* Latest games */

.lp-latestgames {
  height: 466px;
}
.lp-latestgames .title {
  margin-left: 460px;
  margin-top: 56px;
  margin-bottom: 21px;
}
.lp-latestgames .table {
  margin-bottom: 0;
  table-layout: fixed;    /*<<<=====  ADD THIS RULE RIGHT HERE */ 
}
.lp-latestgames .table thead {
  background-color: rgba(0, 0, 0, 0.45);
}
.lp-latestgames .table thead th {
  font-size: 16px;
  font-weight: 500 !important;
  color: white;
  height: 49px;
  vertical-align: middle;
}
.lp-latestgames .table thead > tr > th {
  border-bottom: none;
}
.lp-latestgames .table tbody > tr > td {
  height: 81px;
  border-top: 2px solid #111316;
  background-color: rgba(0, 0, 0, 0.19);
  vertical-align: middle;
  font-size: 14px;
  font-weight: 500;
  color: white;
}
.lp-latestgames .table tbody > tr:first-child > td {
  border-top: none;
}
.lp-latestgames .table tbody > tr > td:first-child,
.lp-latestgames .table thead > tr > th:first-child {
  /* ÜBERARBEITEN!!!!! */
  padding-left: 460px;
  max-width: 200px;
}
.lp-latestgames .table tbody > tr > td:last-child,
.lp-latestgames .table thead > tr > th:last-child {
  /* ÜBERARBEITEN!!!!! */
  padding-right: 460px;
  max-width: 200px;
}
.lp-latestgames .table tbody > tr > td > .gd-c-versus {
  display: block;
  font-weight: normal;
  font-family: Arial;
  color: #494949;
}
.lp-latestgames .table thead > tr > th:nth-child(4),
.lp-latestgames .table thead > tr > th:nth-child(5),
.lp-latestgames .table tbody > tr > td:nth-child(4),
.lp-latestgames .table tbody > tr > td:nth-child(5) {
  text-align: center;
}
<div class="lp-latestgames">
  <!-- Games -->
  <table class="table">
    <thead>
      <tr>
        <th>Name
          <img src="img/gd_content_arrow_dn.png">
        </th>
        <th>Price Pool
          <img src="img/gd_content_arrow_dn.png">
        </th>
        <th>Entry
          <img src="img/gd_content_arrow_dn.png">
        </th>
        <th>Avg Skill
          <img src="img/gd_content_arrow_dn.png">
        </th>
        <th>Time Remaining
          <img src="img/gd_content_arrow_up.png">
        </th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Im bored. Fite me<span class="gd-c-versus">1 vs 1</span>
        </td>
        <td>
          <img src="img/gd_content_coin.png">20</td>
        <td>
          <img src="img/gd_content_coin.png">10</td>
        <td>
          <input type="text" value="730" class="circle">
        </td>
        <td>00:00:32</td>
      </tr>
      <tr>
        <td>EG vs LGD - Wild Cards Entry<span class="gd-c-versus">5 vs 5</span>
        </td>
        <td>
          <img src="img/gd_content_coin.png">1.500.000</td>
        <td>
          <img src="img/gd_content_coin.png">20</td>
        <td>
          <input type="text" value="980" class="circle">
        </td>
        <td>00:01:47</td>
      </tr>
      <tr>
        <td>cyka blyat<span class="gd-c-versus">5 vs 5</span>
        </td>
        <td>
          <img src="img/gd_content_coin.png">20</td>
        <td>
          <img src="img/gd_content_coin.png">10</td>
        <td>
          <input type="text" value="730" class="circle">
        </td>
        <td>00:02:4</td>
      </tr>
    </tbody>
  </table>
</div>

Upvotes: 0

Justinjs
Justinjs

Reputation: 140

Have you declared <!DOCTYPE> in your html page, if not give it a try. This doctype is an instruction to the web browser about what version of HTML the page is written in.

Upvotes: 1

Related Questions