Skip to content
Advertisement

Display the whole content of object in array even if it is too long

I thought it was an issue with CSS so I have tried overflow:auto, text-overflow:ellipsis and display:flex in td

Here is my HTML

    <div class="box" style="overflow-x: auto; height: 90%">
              <div class="box-body">
                <table id="applicant_table" class="table table-bordered table-striped">
                  <tbody>
                       <?php foreach($app_array as arr) { ?>
                    <tr>
                         "<td>" echo $arr->coverletter "</td>"
                          <?php
                          }
                          ?>
                    </tr>
                  </tbody>
                </table>
              </div>
            </div>

How can I display the whole content of my array?

Advertisement

Answer

I think your problem is when you are iterating over the array. You should put the foreach before <tr>, as following below:

<table id="applicant_table" class="table table-bordered table-striped">
    <tbody>
        <?php foreach($app_array as arr) { ?>
            <tr>
                <td> <?php echo $arr->coverletter ?></td>
            </tr>
        <?php } ?>
    </tbody>
</table>
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement