Eliminate any excessive space located at the bottom of the table

How can we adjust the spacing at the bottom of the table to remove extra space?

Currently, it looks like this:

https://i.stack.imgur.com/DwkbG.png

We want it to look like this:

https://i.stack.imgur.com/extDP.png

CSS

.wk_mp_body td {
    background: #282828;
}

.wk_mp_body td {

    padding: 5px 7px;
}

tbody {
    display: table-row-group;
    vertical-align: middle;
    border-color: inherit;
}

table {
    border: 0;
    border-collapse: collapse;
    empty-cells: show;
    font-size: 100%;
}

HTML

<table cellspacing="0" class="border wk_mp_list_table">
    <thead>
      <tr id="wk_mp_tr_heading">
        <th><span><?php echo $helper->__('Product Name') ?></span></th>
        <th><span><?php echo $helper->__('Date') ?></span></th>
        <th><span><?php echo $helper->__('Product Status') ?></span></th>
        <th><span>&nbsp;</span></th>
      </tr>
    </thead>
    <tbody class="wk_mp_body">
      <tr>
        <td><input class="input-text" name="s" placeholder='<?php echo $helper->__(' type="text">' value="<?php echo $this->getRequest()->getParam('s')?>"/&gt;</td>
        <td><span class="wk_mp_td_span"><?php echo $helper->__('') ?> <input class="input-text" id="special_from_date" name="from_date" placeholder='<?php echo $helper->__(' value="<?php echo $this->getRequest()->getParam('from_date')?>">'/&gt;</span> <span class="wk_mp_td_span"><?php echo $helper->__('') ?> <input class="input-text" id="special_to_date" name="to_date" placeholder='<?php echo $helper->__(' value="<?php echo $this->getRequest()->getParam('to_date')?>">'/&gt;</span></td>
        <td><select class="input-text" name="prostatus" style="height:35px;">
          <option value="">
            <?php echo $helper->__('All') ?>
          </option>
          <option value="1">
            <?php echo $helper->__('Approved') ?>
          </option>
          <option value="2">
            <?php echo $helper->__('Unapproved') ?>
          </option>
        </select></td>
        <td><button class="button" style="background:#fc6c0b;" title="Save" type="submit"><span><span><span><?php echo $helper->__('Submit') ?></span></span></span></button></td>
      </tr>
    </tbody>
  </table>

Looking for a solution to fix this issue. Thanks in advance!

Answer №1

To center the content within the td elements, you just need to adjust the vertical-align property from baseline to middle.

tbody td {
  vertical-align: middle;
  background: black;
}
thead th {
  border: 0;
  text-align: left;
  width: 30%;
}
.wk_mp_td_span {
  float: left;
  width: 50%;
}
button span {
  color: #fff;
  float: left;
  text-align: center;
}
button span span {
  padding: 9px 15px 8px;
  text-transform: capitalize;
}
input,
select,
textarea {
  border: 1px solid #dcdcdc;
  border-radius: 0;
  color: #a0a0a0;
  font: 12px/29px Arial, Helvetica, sans-serif;
  height: 29px;
  padding: 2px 8px !important;
  width: 80%;
}
select {
  height: 35px
}
<table cellspacing="0" class="border wk_mp_list_table">
  <thead>
    <tr id="wk_mp_tr_heading">
      <th><span>Product Name</span>
      </th>
      <th><span>Date</span>
      </th>
      <th><span>Product Status</span>
      </th>
      <th><span>&nbsp;</span>
      </th>
    </tr>
  </thead>
  <tbody class="wk_mp_body">
    <tr>
      <td>
        <input class="input-text" name="s" placeholder="Search by product name" type="text" value="">
      </td>
      <td><span class="wk_mp_td_span"><input class="input-text hasDatepicker" id="special_from_date" name="from_date" placeholder="From:" value=""></span>  <span class="wk_mp_td_span"><input class="input-text hasDatepicker" id="special_to_date" name="to_date" placeholder="To:" value=""></span>
      </td>
      <td>
        <select class="input-text" name="prostatus">
          <option value="">
            All
          </option>
          <option value="1">
            Approved
          </option>
          <option value="2">
            Unapproved
          </option>
        </select>
      </td>
      <td>
        <button class="button" style="background:#fc6c0b;" title="Save" type="submit"><span><span><span>Submit</span></span>
          </span>
        </button>
      </td>
    </tr>
  </tbody>
</table>

Answer №2

Can you explain the reason behind having two separate .wk_mp_body td css classes? Is it possible to merge them into a single class?

Have you considered removing the 5px 7px padding from your styling?

Answer №3

Combine the elements from both classes (.wk_mp_body td) For example:

.wk_mp_body td {
background: #282828;
padding: 2px 3px;
}

Decrease the value for padding.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Disabling GPS with HTML5/phonegap: A step-by-step guide

Looking to create a function that can toggle GPS on and off for both iPhone and Android devices ...

Is it possible for CSS to accurately crop images by pixels [Sprite Box]?

I attempted to replicate the math used for the previous image cuts and added my own image, but it appears blank. Can you identify where the issue lies? #paymentForm { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webk ...

Finding a jQuery DOM element without using a loop

Can the element in variable d be identified directly instead of looping through each function? Take a look at the DOM below: <!DOCTYPE html> <html lang="en"> <head> <title></title> <script src="../jquery-ui ...

What is the best method for creating a distinctive identifier in HTML and jQuery?

Coding in HTML: @foreach($permission->childs as $subMenu) <tr> <td>{{$subMenu -> id}}</td> <td> &nbsp; &nbsp;{{$subMenu -> display_name}}</td> <td ...

Error: Unable to modify the div content - Uncaught TypeError: Unable to assign value to innerHTML of null

Attempting to update the contents of a div using JavaScript and innerHTML, but encountering an issue. After implementing the code to change the div's content, the functionality stopped working. The syntax has been double-checked. Tools being used in ...

Make a big picture fit into a tiny container

I have a question about image rendering. What occurs when we try to fit a large image into a small container? Consider, for example, creating an HTML page with a 100x100 px image on a device with a pixel ratio of 2. Situation 1: Placing the image inside a ...

Struggling to use the innerHTML method to update a div within another div element?

<!DOCTYPE html> <html> <head> <title>Business Information Card</title> <script type="text/javascript"> window.onload = init; function init(){ var button = document.getElementById("populate ...

Setting the height of the text area in a three-column layout cannot be achieved using a percentage value

I'm working on creating a 3-column layout with two text areas. The issue I'm facing is that when I adjust the width of the text areas to create columns, the height shrinks. I need a solution that will be compatible with HTML5 browsers - support f ...

Submitting a form through Ajax is resulting in multiple submissions

Whenever I use Ajax to submit this form, it ends up posting multiple times without any obvious reason. Sometimes, it posts the form up to 10 times even though the submit button is clicked only once. I'm puzzled as to why this behavior is happening. An ...

Tips for adding color to the <td> element in an ejs file using nodeJS

I am looking to incorporate a color into my .ejs file. Here is the code snippet I am working with: <% resultList.forEach(function(item, index){ %> <tr> <td><%= item.function %></td> <td><%= item.value %>< ...

What is the best way to incorporate media queries in order to reduce the padding around my image?

Currently, I am working on a small gallery and have successfully implemented Salvattore (similar to Masonry). However, a challenge has arisen when resizing the web page - the padding remains at 10px instead of reducing to 5px as desired. The goal is to e ...

Unable to display image on React page using relative file path from JSON data

Greetings, this is my initial post so please forgive me if I have missed any important information. I'm currently in the process of creating a webpage using react. My goal is to display content on the page by iterating over a relatively straightforwa ...

The "a" HTML link element is stubbornly resisting being attached to an event listener

I have implemented the MutationObserver observer in my program to monitor the addition of elements. One specific condition I am checking for is if the added element is an anchor tag (tag="a") and if the link is a DOI, then I attach a contextmenu ...

What is the best way to deselect the first radio button while selecting the second one, and vice versa, when there are two separate radio groups?

I am looking to achieve a functionality where if the first radio button is selected, I should receive the value true and the second radio button should be unselected with the value false. Similarly, if the second radio button is selected, I should receive ...

The outcome of the Javascript Calculator is showing as "Undefined"

I've been attempting to create a calculator using JavaScript, but I'm facing an issue where the 'operate' function keeps returning Undefined, and I can't seem to figure out why. I suspect that the problem lies with the switch state ...

How can I determine the remaining amount of scroll left in my HTML document?

Is there a method to determine how many pixels of scroll remain on the page when the scrollbar is set at a specific position? I am currently utilizing jQuery's scrollLeft feature, which can be found here: http://api.jquery.com/scrollLeft/. I want to ...

Learn the process of sending information to a MySQL table using a select tag in PHP

I am attempting to use a select tag to submit data to a MySQL table using PHP. I have been successful in inserting data using the text type with the following code: <td> <label class="control-label">Image Type </label> </td> &l ...

Having trouble with bootstrap carousel malfunctioning on Firefox browser?

I'm experiencing an issue with the carousel slider on my website. It seems to only be working in Chrome and not in Mozilla Firefox. You can view the live site at: Below is the code I have used for the carousel: <header id="myCarousel" class="car ...

Calculating remaining change with the modulus operator in JavaScript

I have a task where I need to convert any given number of pennies into the correct amount of Quarters, Dimes, Nickels, and leftover pennies. My program currently uses Math.floor() to calculate the total value of each respective coin type when executed in ...

Retrieve content inside an iframe within the parent container

Hey there! I've been working on adding several iframes to my webpage. Each iframe contains only one value, and I'm trying to retrieve that value from the parent page. Despite exploring various solutions on Stack Overflow, none of them seem to be ...