How to align Table Header and columns in the same row without resizing to next line in HTML ?? anyone please help me. ?
You need to add class "table-responsive" to the upper div of table tag. By using this when your columns are more than screen size it will start scrolling. And you won't face any issue as you described.
For more details, Refer this link --> https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_table-responsive&stacked=h
Hope this will help you.
If we used * white-space: nowrap* it will not move to next line.
sample CSS code:
td, th {
white-space: nowrap;
overflow: hidden;
text-align: center;
padding: 10px;
text-align: left;
font-size: 18px;
}
Related
I want you to help me with the "horizontal scroll bar" coming in the HTML. I don't want it but it is unnecessarily coming please debug my code and please tell me the problem that is with this code.
My code is hereenter image description here:-
https://drive.google.com/drive/folders/16Uocf15o0XBovswjvGvLf3CRRwyIze7P?usp=sharing
Regards,
Hridyansh Sati
In your css file you use translate to center a heading which is wrong practice.
Assuming that your heading is in a div, you can center it with text-align:center;
If you want to vertically align it, you will need to use Flexbox or Grid.
To solve your problem, change your .sec2 css class to this:
.sec2{
color: rgb(255, 0, 0);
font-size: 80px;
font-family: 'Nunito', sans-serif;
text-align: center;
}
As stated, you must add your code in your question.
Please add some CSS into your stylesheet I hope it will work.
body{
overflow-y: scroll;
overflow-x: hidden;
}
I want to create the following table: https://fiddle.jshell.net/7zrmd2wa/
The output is good on Fiddle, but if I host it myself then it outputs this, the buttons aren't aligned. https://imgur.com/a/byaM5
I've tested it with different browsers.
I don't understand why? And how can I solve it?
Add the following and it should fix the problem. I was able to reproduce your issue when I started the code on a separate html file
#table1 td form{
display: inline;
}
or
#table1 td form{
display: table-cell;
}
Add this CSS to get vertical centering in all cells:
td {
vertical-align: middle;
}
Try add this in your stylesheet:
* {
padding: 0;
margin: 0;
border: none;
}
Try this way: jsfiddle edited
Looking at the sample, it should work unless you've got some additionnal CSS.
I have having a few problems, with what should be a simple task.
I have spent a good while trying to fix them, but no luck.
Centre the Input boxes within the div - tried this solution, (didn't work): http://jsfiddle.net/pjAHG/27/
input {
display: block;
margin: auto;
max-width: 80%;
}
Make the background image fill the full screen, only to the bottom of my timer div... if I use a solid colour, it fills the screen though :/ I have tried all the ways I can find online, but no luck.
Media query does not seem to change the size of the text/submit button.
If anyone could share some info, or help for these problems, I would be grateful.
Here is my code:
https://codepen.io/anon/pen/dVNZZO
Thanks :)
Try this
.input-group{
max-width:80%;
margin:0 auto;
}
and
#media (max-width:768px) {
.btn-lg{
display:block;
max-width:100%;
white-space:normal;
}
.lead-subtitle {
color: #dbdbdb;
text-decoration: underline;
font-size: 1em;
display:block;
}
}
here is the updated pen.
centered the form element instead of the input fields as they are
set to display: table by bootstrap anyway
this question doesn't make quite sense to me. I have added a sample image and it fills the whole bg, have a look
Bootstrap sets white-space: nowrap for the .btn class; I overwrote it for you
https://codepen.io/anon/pen/xXgPjZ
I have a table that I've inserted buttons into the cells of. However, try as I might, I can't get rid of some whitespace that shows up between the top of the cell and the button.
Here's an example in Jsfiddle:
http://jsfiddle.net/7Bz36/1/
Where I have a simple table with a button
<table border="1">
<tr>
<td>
<button id="1"></button>
</td>
</tr>
</table>
with some css and attempts to get rid of it:
button {
height: 15px;
width: 15px;
border-radius: 0px;
margin: 0px;
white-space: none;
}
table {
border-collapse: collapse;
}
tr td {
height: 15px;
padding: 0px;
Can anyone figure out how to get rid of it? Thanks!
You are not using any text value for the button, use font-size: 0; or line-height: 0;
Demo (Font Size 0)
Demo 2 (Line Height 0)
Also id="1" is invalid, id name cannot be started with an int
Try this:
button {
height: 15px;
width: 15px;
border-radius: 0px;
display: block;
}
table, td, button {
margin: 0px;
padding: 0px;
}
This will set margins and paddings of all the elements involved to 0px; and set the button element to display: block; to get rid of some inline element white-space.
jsFiddle
It is not clear what the problem is via your jsfiddle.
Also, none is not a valid property of white-space in your CSS. Do you know what your doing, or are you just adding random styling hoping that it will work?
Anyway, your code is not properly formatted, the CSS ends in </table>, what? Also, your html is not constructed properly here, nor in the jsfiddle.
It doesn't seem you put much research into this question at all, but rather tried randomness and SO.
I'd love to help you, but I can't see the problem. It's not well explained here and it's not shown in the jsfiddle.
input field are not getting aligned and they flow out of the container. What causes that? Here is the code and page. I need the labels aligned left and input field all aligned too. Is it ok to give -ve margins??
the .para#info div is flowing out of the page. It is supposed to sit parallel with .para#news
You have overdone your CSS and have many unneeded properties.
Start by giving your label the following CSS properties, then style the inputs as you wish.
label {
width: 100px;
display: inline-block;
margin: 2px 6px 6px 4px;
text-align: right;
font-weight: bold;
color: #555;
}
Check working example at http://jsfiddle.net/6Eyef/1/
Its ok if you use..
margin-left: -220px;
margin-top: -150px;
for info Div.
thank you.
I'm not sure if I understand your question correctly. But to align <input> elements with their labels, the <label> tags need to have to following CSS:
display: block;
float: left;
width: (a value)px;
And you need to add clear: left to the <input> elements
Edit: Hussein's answer is better