Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the table height?

I want to fix the table height to 600px, eve if the content goes long.

like image 363
Jacob_pgr Avatar asked Nov 18 '09 06:11

Jacob_pgr


People also ask

How do you fix the height of a table?

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.

How do you fix the height of a row in a table?

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.

How do I fix the height of a table in Powerpoint?

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.

How do you fix the size of a table in HTML?

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.


1 Answers

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.

like image 59
Amber Avatar answered Oct 09 '22 04:10

Amber