html - padding from outside table border line -


quick question. have table, has border. when add padding, adds padding from inside of table. way make add padding outside border?

essentially, table border lines should appear within cell.

regards (whatever displayed as)

enter image description here

im not 100% sure mean may want this.

html:

<table>     <tr>         <td>cell 1</td>         <td>cell 2</td>     </tr> </table> 

css:

body {     padding: 20px; } table {     width: 400px;     height: 400px;     outline:2px solid red;     outline-offset: -15px; } td {     border:2px solid blue; } 

table only:

demo here

cell only:

demo here

so here setting outline , can put outline-offseton it. bring table if use - value. use border remember doesn't count towards width or height.

note: can use on each cell etc.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -