I want to fix the table height to 600px, eve if the content goes long.
The height of rows 'tr' in a table can be fixed very easily. This can be done by adding the height attribute in the tr tag. If the height is not specified, the height of the row changes according to the content. The height can be specified either in pixels, or percentage.
Change column and row widthSelect the boundary of the column or row you want to move and drag it to the width or height you want. Select the rows or columns and then select Layout and choose your height and width. Select View > Ruler checkbox, select the cell you want, and then drag the markers on the ruler.
Click the table that you want to resize. Under Table Tools, on the Layout tab, in the Table Size group, enter the size that you want in the Height and Width boxes. To maintain the same ratio between the height and width of the table when you resize it, select the Lock Aspect Ratio check box.
To manipulate the height or width of an entire table, place the size attribute (either "WIDTH=" or "HEIGHT=") within the <TABLE> code. To manipulate individual cells, place the size attribute within the code for that cell.
Try wrapping the table within a div
tag, and setting the CSS properties of the div
like so:
div.tablewrapper {
height: 600px;
overflow-y: auto;
}
This will make a scrollbar appear if the table's height exceeds 600 pixels. If you don't want to always force the height to 600px if the table it too small to take up that much space, but instead just want 600px to be the max, use max-height
instead of height
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With