Search code examples
htmlcssscrollbarheight

How do I set the height of an html table?


I have read and tried everything that I can find regarding setting the height of a table, row, etc. in HTML, but none of it works. I'm trying to make an auto-scrolling marquee with a border, and I have it all working except for the table height. The text is rather long, so the entire webpage (including the border) scrolls several pages long. I need to statically set a fixed table/row size to fit onto one single non-scrollable (meaning that I don't want the window to have a scroll bar at all) browser window (say of 800px) which fully contains the border, and then have the very long text auto-scrolling within the border.

Here's my code:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
</head>
<style type='text/css'>
html, body {
   background-color: black;
}
table {
   border-spacing: 30px;
   border: 30px;
   border-style: ridge;
}
td {
   padding: 30px;
}
p {
   font-family: calibri;
   color:white;
   font-size: 500%;
   text-align:center;
}
</style>
<body>
<div config-table>
<table align="center">
<tr>
<td align ="center">
<marquee behavior="scroll" direction="up" scrollamount="3">
<p>Here I have several paragraphs of text</p>
</marquee>
</td>
</tr>
</table>
</div>
</body>
</html>

Solution

  • Unsure if this is what you're asking for:

    <marquee style="border:1px solid red; height:50px;" behavior="scroll" direction="up" scrollamount="3">
    <p>Here I have several paragraphs of text</p>
    </marquee>
    

    You can remove the red border.

    Let me know if that's what you're trying to do.