Jump to content

Remove second column from a table


shedokan

Recommended Posts

How can I remove the "Column2" from the table?

So that:

<table>
<tr><th>Date
<th width='13%'>Column1
<th width='13%'>Column2
<th width='13%'>Column3
</tr>
<tr><td>06/20 Fri</td><td >0</td>
<td >0</td>
<td >0</td>

</tr>
<tr><td>06/21 Sat</td><td >0</td>
<td >0</td>
<td >0</td>

</tr>
</table>

 

will be converted into this:

 

<table>
<tr><th>Date
<th width='13%'>Column1
<th width='13%'>Column3
</tr>
<tr><td>06/20 Fri</td><td >0</td>
<td >0</td>

</tr>
<tr><td>06/21 Sat</td><td >0</td>
<td >0</td>

</tr>
</table>

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/163006-remove-second-column-from-a-table/
Share on other sites

How can I remove the "Column2" from the table?

Given your input I'd say open a text editor and remove the column but that's probably not what you mean.

 

specify your problem a bit more such as:

  • How do you wish to remove the column.
  • When do you want to remove this column
  • Where is this html table
  • etc

the more detail the easier someone can help

What I mean is that I have the html like this:

<?php

$table="<table>
<tr><th>Date
   <th width='13%'>Column1
   <th width='13%'>Column2
   <th width='13%'>Column3
</tr>
<tr><td>06/20 Fri</td><td >0</td>
<td >0</td>
<td >0</td>

</tr>
<tr><td>06/21 Sat</td><td >0</td>
<td >0</td>
<td >0</td>

</tr>
</table>";

// here some regular expression or something
?>

 

I just don't have any clue on how to do this.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.