Search code examples
csszurb-ink

How to make two columns same height - Zurb INK


I have two columns, one have more content = is bigger, but I want that black one to be same height like that on the right.

enter image description here

There is workaround that you add div around table width height 100% and display: inline-block, but it is an ugly hack.

Anyone know solution?

<table class="body">
        <tr>
            <td class="center" align="center" valign="top">
        <center>

            <table class="container">
              <tr>
                <td>

                <table class="row">
                  <tr>
                    <td class="wrapper">

                      <table class="six columns" style="background-color: black; color: white;">
                        <tr>
                          <td align="center" style="vertical-align: middle;">
                            <center style="vertical-align: middle; color:white;">
                              TEXT
                            </center>
                          </td>
                          <td class="expander"></td>
                        </tr>
                      </table>

                    </td>

                    <td class="wrapper last">

                      <table class="six columns" style="background-color: lightgray; color: white;">
                        <tr>
                          <td align="center">
                            <center>
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                                TEXT</br />
                            </center>
                          </td>
                          <td class="expander"></td>
                        </tr>
                      </table>

                    </td>

                  </tr>
                </table>

              <!-- container end below -->
              </td>
            </tr>
          </table>

        </center>
            </td>
        </tr>
    </table>

Solution

  • CSS class is what you need. If you are just wanting the tables to be the same height just set the height for them both as the same. either in-line or in a much easier way to manage is as a class applied to them both as below. I also added your in-line code as css as its a far better approach.

        <html>
    <head>
    <style type="text/css">
    .tableHeight{
      height: 500px;
    
    }
    
    #lefttable{
      background-color: black;
      color: white;"
    
    }
    
    #rightTable{
      background-color: lightgray;
      color: white;
    }
    
    </style>
    
    </head>
    <body>
    <table class="body">
            <tr>
                <td class="center" align="center" valign="top">
            <center>
    
                <table class="container">
                  <tr>
                    <td>
    
                    <table class="row">
                      <tr>
                        <td class="wrapper">
    
                          <table id="leftTable" class="six columns tableHeight">
                            <tr>
                              <td align="center" style="vertical-align: middle;">
                                <center style="vertical-align: middle; color:white;">
                                  TEXT
                                </center>
                              </td>
                              <td class="expander"></td>
                            </tr>
                          </table>
    
                        </td>
    
                        <td class="wrapper last">
    
                          <table id="rightTable" class="six columns tableHeight">
                            <tr>
                              <td align="center">
                                <center>
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                    TEXT</br />
                                </center>
                              </td>
                              <td class="expander"></td>
                            </tr>
                          </table>
    
                        </td>
    
                      </tr>
                    </table>
    
                  <!-- container end below -->
                  </td>
                </tr>
              </table>
    
            </center>
                </td>
            </tr>
        </table>
        </body>
        </html>