Remove all padding and margin table HTML and CSS
Try to use this CSS:
/* Apply this to your `table` element. */
#page {
border-collapse: collapse;
}
/* And this to your table's `td` elements. */
#page td {
padding: 0;
margin: 0;
}
How to remove margin and padding from css table
This happens only in Chrome and IE (not in Firefox, interesting...), and you can fix it on this way, too:
.button {
display:block;
}
So, button is by default - inline element (and that's the cause of this small gap), and this way it will fill 100% height...
https://jsfiddle.net/n841wvwn/12/
How to remove the default table border/spacing/padding?
make your code as below:
<table style="background-color: blue;" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
</td>
</tr>
</table>
How to remove html table data padding
To make the buttons the same size, force them to occupy a specific width (in my example, 98% of the available width)
to create "padding" make them smaller then the full available width and center them (please note the css vertical-align
is the recommended way to align a td over the deprecated align
attribute
#page { border: 0px; border-collapse: collapse; border-spacing: 0px;}
#page td { padding: 0; margin: 0; vertical-align: center}
input[type="button"] { width: 98%;}
Hello world <br/>
<table id="page"> <tr> <td align="left"><input type='button' value='button1'></td> <td align="left"><input type='button' value='button2'></td> <td align="left"><input type='button' value='button3'></td> <td align="left"><input type='button' value='button4'></td> </tr> <tr> <td align="left"><input type='button' value='Sort Name A-Z'></td> <td align="left"><input type='button' value='Save sorting'></td> </tr></table>
Removing unwanted padding/margin/border in table of images HTML
Try to remove cellspacing
& cellpadding
:
<table align="center" class="gridStyle" cellpadding="0" cellspacing="0">...</table>
Is there a way to remove the margin between table displayed tables but still have margins between all other elements and tables?
In HTML file add this div with class as parent element of tables
<div class="my-tables">
<table class="beast">
<table class="beast">
</div>
In CSS add this code
.my-tables table {
margin-bottom: 0px;
}
.my-tables table:last-child {
margin-bottom: 50px;
}
How to remove padding and border from table cells?
looks like the problem is on line 80 of your javascript.
$("#tableGame").append("<tr><td>"+ map[i] + "<td></tr>")
you're concat-ing an array (map[i]
) into a string. javascript by default "stringify" it by join
ing it with commas.
The code above is like:
$("#tableGame").append("<tr><td>"+ map[i].join() + "<td></tr>")
since the default joining string is comma, that's equivalent to
$("#tableGame").append("<tr><td>"+ map[i].join(',') + "<td></tr>")
To get rid of the commas you simply joining it with an empty string
$("#tableGame").append("<tr><td>"+ map[i].join('') + "<td></tr>")
Remove padding in table
try to make the div padding 0 the container
.el-table {
padding: 0px
}
Remove All Padding/Borders/Margin
You also need to set the border-collapse
property for the table. The default value is separate
:
table {
border-collapse: collapse;
}
Related Topics
Create a Row of Flexbox Items with a Max Height Defined by One Child
Multiple Font-Weights, One @Font-Face Query
How to Make This Header/Content/Footer Layout Using CSS
Select Inputs and Text Inputs in HTML - Best Way to Make Equal Width
:Active CSS Selector Not Working for IE8 and IE9
Css3 Transform Order Matters: Rightmost Operation First
How to Use a CSS Wildcard in the Middle of an Attribute Selector
Can Type Selectors Be Repeated to Increase Specificity
Css3 Flexbox: Display: Box VS. Flexbox VS. Flex
Overlay a Background-Image with an Rgba Background-Color
Change Outline for Outlinedinput with React Material-Ui
Vertical and Horizontal Align (Middle and Center) with CSS
Twitter's Bootstrap 3 Grid, Changing Breakpoint and Removing Padding