Jump to content

Abreviating Text in Table Cell


alan_k
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...