Home > Mobile >  HTML & CSS : How delete <td> tag from print view
HTML & CSS : How delete <td> tag from print view

Time:10-06

I have a table :

<table>
  <tr>
     <td>#</td>.
     <td>Nmae</td>
     <td class="notforprint">Class</td>
  </tr>
  <tr>
     <td>1</td>.
     <td>Jhon</td>
     <td class="notforprint">A</td>
  </tr>  <tr>
     <td>2</td>.
     <td>Tom</td>
     <td class="notforprint">B</td>
  </tr>
</table>

I create css style to hide tag :

<style>
    @media print {
        .notforprint{
            visibility: hidden;
        }
    }
</style>

and it is works fine.

but the tags take thier space in view therefor I want to delete those in print view.

is that possible?

CodePudding user response:

you can disable the display with:

.notforprint
{
display: none;
}

  • Related