There is an example of a label:
It is necessary that it be like this:
Those. so that the cells have an indent from the edges of the table, how to do this? I tried paddings, but they do not work on the cell, but only on its contents.
You can try to "nakostilyt" with additional cells.
table { width: 250px; height: 50px; text-align: center; vertical-align: middle; border-collapse: collapse; } td { border: 2px solid blue; margin: 10px; background-color: white; padding: 10px; } .brdL, .brdR { width: 5px; border-top: none; border-bottom: none; padding: 0; } .trTop td, .trBot td{ height: 5px; } .trTop .brdL, .trTop .brdR { border-top: 2px solid blue; } .trBot .brdL, .trBot .brdR { border-bottom: 2px solid blue; } .brdLR { border-left: none; border-right: none; padding: 0; } .brdL { border-right: none; } .brdR { border-left: none; }
<table> <tr class="trTop"> <td class="brdL"></td> <td colspan="4" class="brdLR"></td> <td class="brdR"></td> </tr> <tr> <td class="brdL"></td> <td colspan="2">12</td> <td colspan="2">24</td> <td class="brdR"></td> </tr> <tr> <td class="brdL"></td> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td class="brdR"></td> </tr> <tr class="trBot"> <td class="brdL"></td> <td colspan="4" class="brdLR"></td> <td class="brdR"></td> </tr> </table>
Source: https://ru.stackoverflow.com/questions/547313/
All Articles
padding
ormargin
. It is not clear from the question whether to center the text or add text on the left. From what edges, only to the left or from all, is unknown - Mr. Blackcellpadding
needed - Mr. Black