datatable jquery – table header width not aligned with body width

CAUSE Most likely your table is hidden initially which prevents jQuery DataTables from calculating column widths. SOLUTION If table is in the collapsible element, you need to adjust headers when collapsible element becomes visible. For example, for Bootstrap Collapse plugin: $(‘#myCollapsible’).on(‘shown.bs.collapse’, function () { $($.fn.dataTable.tables(true)).DataTable() .columns.adjust(); }); If table is in the tab, you need … Read more

CSS: Center block, but align contents to the left

First, create a parent div that centers its child content with text-align: center. Next, create a child div that uses display: inline-block to adapt to the width of its children and text-align: left to make the content it holds align to the left as desired. <div style=”text-align: center;”> <div style=”display: inline-block; text-align: left;”> Centered<br /> … Read more

HorizontalAlignment=Stretch, MaxWidth, and Left aligned at the same time?

You can set HorizontalAlignment to Left, set your MaxWidth and then bind Width to the ActualWidth of the parent element: <Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”> <StackPanel Name=”Container”> <TextBox Background=”Azure” Width=”{Binding ElementName=Container,Path=ActualWidth}” Text=”Hello” HorizontalAlignment=”Left” MaxWidth=”200″ /> </StackPanel> </Page>

trying to align html button at the center of the my page [duplicate]

Here’s your solution: JsFiddle Basically, place your button into a div with centred text: <div class=”wrapper”> <button class=”button”>Button</button> </div> With the following styles: .wrapper { text-align: center; } .button { position: absolute; top: 50%; } There are many ways to skin a cat, and this is just one.

How to align input forms in HTML

The accepted answer (setting an explicit width in pixels) makes it hard to make changes, and breaks when your users use a different font size. Using CSS tables, on the other hand, works great: form { display: table; } p { display: table-row; } label { display: table-cell; } input { display: table-cell; } <form> … Read more

Align button at the bottom of div using CSS

You can use position:absolute; to absolutely position an element within a parent div. When using position:absolute; the element will be positioned absolutely from the first positioned parent div, if it can’t find one it will position absolutely from the window so you will need to make sure the content div is positioned. To make the … Read more

How to center icon and text in a android button with width set to “fill parent”

All the previous answers seem to be outdated You can use the MaterialButton now which lets setting the icon gravity. <com.google.android.material.button.MaterialButton android:id=”@+id/btnDownloadPdf” android:layout_width=”0dp” android:layout_height=”56dp” android:layout_margin=”16dp” android:gravity=”center” android:textAllCaps=”true” app:backgroundTint=”#fc0″ app:icon=”@drawable/ic_pdf” app:iconGravity=”textStart” app:iconPadding=”10dp” app:iconTint=”#f00″ app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent” tools:text=”Download Pdf” /> For using the material components you will obviously need to: Add a dependency implementation ‘com.google.android.material:material:1.3.0-alpha01’ (use latest … Read more

Stacking Divs from Bottom to Top

All the answers miss the scrollbar point of your question. And it’s a tough one. If you only need this to work for modern browsers and IE 8+ you can use table positioning, vertical-align:bottom and max-height. See MDN for specific browser compatibility. Demo (vertical-align) .wrapper { display: table-cell; vertical-align: bottom; height: 200px; } .content { … Read more