Witam
Robię stronę, której budowa, mniej więcej będzie wyglądała tak
(IMG:https://naforum.zapodaj.net/thumbs/216a2256b960.png)
Czyli nagłówek, menu, pole na kontent (w którym jest tabela) i stopka. Oczywiście to co pokazuję, to tylko strona testowa, nie ta właściwa (IMG:
style_emoticons/default/smile.gif)
I chodzi mi właśnie o tą tabelkę z suwakiem po prawej. Chciałbym, żeby nagłówki w obszarze thead, były nieruchome, a tylko dane na szarym tle w obszarze tbody, żeby się przesuwały.
Czy mógłby mi ktoś momóc poprawić kod, żeby tylko szary obszar się przesuwał, bez brązowego? Proszę o pomoc, poniżej wstawiam kod
HTML<!doctype html>
<link rel="stylesheet" href="style.css" type="text/css" /> <header>
naglowek
</header>
<nav>menu</nav>
<article>
<th><a href="#">Header 1
</a></th> <th><a href="#">Header 2
</a></th> <th><a href="#">Header 3
</a></th> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> <td>More Cell Content 1
</td> <td>More Cell Content 2
</td> <td>More Cell Content 3
</td> <td>Even More Cell Content 1
</td> <td>Even More Cell Content 2
</td> <td>Even More Cell Content 3
</td> </article>
<footer>
stopka
</footer>
CSShtml, body {
height: 100%;
margin: 0;
}
header {
background: red;
height: 10%;
}
nav {
background: green;
height: 10%;
}
article {
background: yellow;
height: 65%;
position: relative;
overflow: auto;
}
table {
width: 100%;
border-collapse: collapse;
}
thead th {
background: #C96;
border-left: 1px solid #EB8;
border-right: 1px solid #B74;
border-top: 1px solid #EB8;
font-weight: normal;
padding: 4px 3px;
text-align: left;
}
thead a,
thead a:link,
thead a:visited {
color: #FFF;
text-decoration: none;
}
thead a:hover {
text-decoration: underline;
}
tbody {
overflow: auto;
}
tbody tr td {
background: #EEE;
border-left: 1px solid #DDD;
border-right: 1px solid #CCC;
border-top: 1px solid #DDD;
padding: 2px 3px;
}
footer {
background: blue;
height: 15%;
}
Z góry dziękuję za pomoc
Ten post edytował Baku12345 29.03.2019, 04:31:19