Jump to content

Trying to make Bootstrap buttons completely fill the TD which contains them


Go to solution Solved by mongoose00318,

Recommended Posts

image.thumb.png.a215e1115b891df8dbb758cc4de39801.png

 

I have tried using bootstraps h-100 and w-100 to make it work as well as other things. I wont know the row height for each page so I need the buttons to fill the container TD. 

 

Why won't bootstraps h-100/w-100 classes work?

I could but I'd have to recode a lot and I've always found bootstraps buttons easy to use.

 

https://stackoverflow.com/questions/53520077/css-100-height-in-a-tablecell

 

What do you think about that?

  • Solution

image.thumb.png.2199fb35a35388bfff825de9e7b0a9c8.png

 

I got it working with this:

		function updateTableAfterSubmit() {
			table.ajax.reload( function (json){
				auto_btn_height_width();
			}, false );
		}

		function auto_btn_height_width() {
			$('td.mfg-view-cols').each(function() {
				tdWidth = $(this).width();
				tdHeight = $(this).height();

				$(this).find('button').css({'width': tdWidth, 'height': tdHeight});

				console.log(tdHeight);
			});
			console.log($('td.mfg-view-cols').length);
		}

Then just had to make sure I identified the right events to do call backs on. Works great now.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.