Questions tagged [padding]

Extra space inserted into memory structures to achieve address alignment -or- extra space between the frame and the content of an HTML element -or- extra spaces or zeros when printing out values using formatting print commands like, in C, the printf*-family of functions.

Padding in memory structures is the insertion of additional bytes of unused space to make the internal fields of a structure align to desirable address boundaries.

Padding in HTML layout is extra space inserted between the content of the element and its border or frame. Padding is space added to the interior of the element; margin is space around the exterior of the element.

In arrays, padding is addition of extra 0's (zeros) in one or more dimension of the array in a symmetric, circular or replicating manner. This is important for signal and image processing, in the context of and convolution.

3939 questions
31
votes
4 answers

How to format a float with a maximum number of decimal places and without extra zero padding?

I need to do some decimal place formatting in python. Preferably, the floating point value should always show at least a starting 0 and one decimal place. Example: Input: 0 Output: 0.0 Values with more decimal places should continue to show them,…
KChaloux
  • 3,918
  • 6
  • 37
  • 52
30
votes
4 answers

Space between div and img?

I have code like this:

1. Orange

some text in here

There's…
fomicz
  • 1,752
  • 7
  • 25
  • 33
30
votes
3 answers

Why padding is included in height sometimes?

I have a text area and I added some CSS to it and CSS applied to it - .test-input { border: 1px solid #D0D0D0; …
Ashmah
  • 842
  • 2
  • 8
  • 17
29
votes
5 answers

Border-radius and padding not playing nice

I'm having trouble trying to get a radius on images. I've simplified my problem and exaggerated the variables for demonstration purposes. CSS: div.wrap img { -moz-border-radius: 50px; border-radius: 50px; } img.pic { padding: 15px…
Curtis Cook
  • 397
  • 1
  • 3
  • 8
29
votes
4 answers

CSS: How can I get rid of the default window "padding"? An element set to 100% width doesn't reach the window's borders

So I have an element that is placed directly inside body: Other stuff... The following is the CSS used: body{ text-align:center; } #header{ margin:auto; } So the #header div is…
Alex
  • 1,157
  • 3
  • 11
  • 25
29
votes
4 answers

Optimising datastructure/word alignment padding in golang

Similar to what I've learned in C++, I believe it's the padding that causes a difference in the size of instances of both structs. type Foo struct { w byte //1 byte x byte //1 byte y uint64 //8 bytes } type Bar struct { x byte //1…
nohup
  • 3,105
  • 3
  • 27
  • 52
28
votes
2 answers

Why does this struct padding trick work?

Consider this simple program #include struct A { int x1234; short x56; char x7; }; struct B : A { char x8; }; int main() { std::cout << sizeof(A) << ' ' << sizeof(B) << '\n'; return 0; } This prints 8 12.…
PBS
  • 1,389
  • 11
  • 20
28
votes
5 answers

How to apply CSS to a Mac Chrome Select Box?

Doesn't matter what I do, using Mac OSX 10.9.2 and Chrome Version 33.0.1750.152, padding, background-color, nothing works. I am really just wanting to apply a padding-top and padding-bottom of 5px on a select element, works everywhere cept Chrome…
Solomon Closson
  • 6,111
  • 14
  • 73
  • 115
28
votes
3 answers

How to adjust gutter in Bootstrap 3 grid system?

The new Bootstrap 3 grid system is great. It's more powerful for responsive design at all screen sizes, and much easier for nested. But I have one issue I could not figure out. How do I add precise gap between the columns? Say I have container…
Darren Li
  • 381
  • 1
  • 3
  • 6
28
votes
4 answers

Is there any way to add padding to select options via CSS?

I want to add some kind of space (padding, margin or whatever) between select options in HTML using CSS. I am currently using Chrome and I've already tried using something like this: select option { padding: 10px } However it didn’t work.…
Correia JPV
  • 610
  • 3
  • 10
  • 25
28
votes
4 answers

Is there a GCC keyword to allow structure-reordering?

I know why GCC doesn't re-order members of a structure by default, but I seldom write code that relies on the order of the structure, so is there some way I can flag my structures to be automaticly reordered?
Maestro
  • 9,046
  • 15
  • 83
  • 116
27
votes
6 answers

How can I add padding to a jtextfield

How can I add some padding to a jtextfield? I've tried tf.setMargin(new Insets(5,5,5,5)); which doesn't have any effect.
fenerlitk
  • 5,414
  • 9
  • 29
  • 39
27
votes
6 answers

How to remove unwanted spaces at the right of CheckBox?

I am working on a custom list view. I want to show a CheckBox at the custom view. There is no text for the CheckBox. I found it always have some spaces at the right of the CheckBox. Here is my layout xml file:
27
votes
4 answers

overflow: hidden behind padding

Is it possible to define where overflow: hidden begins based on padding? For example, I currently have a table in which I have a long string. There is padding on the left, but the length of the string exceeds the td, so overtflow hidden is…
developthewebz
  • 1,827
  • 3
  • 17
  • 43
27
votes
4 answers

Table padding not working

I have a table that sits within a parent div full of body text and other content. I have the following CSS which does not seem to work: table {width:100%; padding: 0 50px 0 50px;} When I use margins instead of padding, it works—however, with…
Hank
  • 499
  • 1
  • 5
  • 8