Jump to content

Abreviating Text in Table Cell


Recommended Posts

Hello,

I have been researching a question I have but cant seem to find an answer for my situation. I have a simple html form that in a couple of fields may require user to write a longer then usual response on the trouble she is experiencing. What I would like is for that table cell to abbreviate the text and I have a link (called More) to the full page for that indivual row which can display the whole trouble report. Right now the whole text appears in the table cell and distorts the display. Is there a way to do this. Thanks. Here is the code for the table. It is the row with 'Problem' variable I would like to abbreviate.

<table  class="table table-striped table-bordered table-hover" cellpadding="10" cellmargin="5" border="3">    <tr>        <th id="table_header">First Name</th>        <th id="table_header">Last Name</th>        <th id="table_header">Reach #</th>        <th id="table_header">Room Number</th>        <th id="table_header">Type of Trouble</th>        <th id="table_header">Room Availability</th>        <th id="table_header">Trouble Report</th>        <th id="table_header">Ticket Status</th>        <th id="table_header">Assignment</th>        <th id="table_header">TT Number</th>        <th id="table_header"></th>    </tr>    <?php    foreach($model as $row)    {        echo "<tr class='success'>";        echo '<td>'. $row['FName'] .'</td>';        echo '<td>'. $row['LName'] .'</td>';        echo '<td>'. $row['Rch_Num'] .'</td>';        echo '<td>'. $row['Rm_Number'] .'</td>';        echo '<td>'. $row['Prob_Cat'] .'</td>';        echo '<td>'. $row['Rm_Avail'] .'</td>';        echo '<td>'. $row['Problem'] .'</td>';        echo '<td><i>'. $row['Tkt_Status'] . '</i></td>';        echo '<td>'. $row['Assgnd_Tech'] .'</td>';        echo '<td>' . $row['TT_Num'] . '</td>';        echo "<td class='info'><a class=one href='tt_record.php?id=" . $row['id'] . "'>More...</a></td>";       echo "</tr>";    }?></table>

 

 

 

Link to post
Share on other sites

Further Research and found this answer which works pretty good.....

<table class="table table-striped table-bordered table-hover" cellpadding="10" cellmargin="5" border="3">    <tr>        <th id="table_header">First Name</th>        <th id="table_header">Last Name</th>        <th id="table_header">Reach #</th>        <th id="table_header">Room Number</th>        <th id="table_header">Type of Trouble</th>        <th id="table_header">Room Availability</th>        <th id="table_header">Trouble Report</th>        <th id="table_header">Ticket Status</th>        <th id="table_header">Assignment</th>        <th id="table_header">TT Number</th>        <th id="table_header"></th>    </tr>    <?php    foreach($model as $row)    {        echo "<tr class='success'>";        echo '<td>'. $row['FName'] .'</td>';        echo '<td>'. $row['LName'] .'</td>';        echo '<td>'. $row['Rch_Num'] .'</td>';        echo '<td>'. $row['Rm_Number'] .'</td>';        echo '<td>'. $row['Prob_Cat'] .'</td>';        echo '<td>'. $row['Rm_Avail'] .'</td>';        echo '<td width="50" height="30">' . '<div style="width:550px; Height:55px; overflow: auto">' . $row['Problem'] . '</div>' . '</td>';        echo '<td><i>'. $row['Tkt_Status'] . '</i></td>';        echo '<td>'. $row['Assgnd_Tech'] .'</td>';        echo '<td>' . $row['TT_Num'] . '</td>';        echo "<td class='info'><a class=one href='tt_record.php?id=" . $row['id'] . "'>More...</a></td>";       echo "</tr>";    }?></table>

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...