A
A
Arthur Koch2018-06-09 12:30:03
Layout
Arthur Koch, 2018-06-09 12:30:03

How to remove indent from a table cell?

There is the following construction

<table width="100%">
 <tr>
  <th style="font-size: 0; padding: 0;">&nbsp;</th>
  <th width="600" style="padding: 0;">
   <!-- content -->
  </th>
  <th style="font-size: 0; padding: 0;">&nbsp;</th>
 </tr>
</table>

Thus, we get a fixed-width rubber table on the desktop and 100% on the smartphone.
Problem : empty `th` cells are 1px wide in Safari
Problem : remove this padding without using media queries

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Belyh, 2018-06-09
@Belyh

Reset line-height.

C
CODALSD, 2018-06-09
@CODALSD

If for a letter, then as a rule you need to register in styles or for specific tags

* {
margin:0;
padding:0;
border:0;
}

and for table tags write
<table cellpadding="0" cellspacing="0">

M
monochromer, 2018-06-09
@monochromer

border-spacing: 0;
or perhaps, for the reliability of table layouts
table-layout: fixed;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question